In order to ensure the UI is always responsive, you can disallow blocking calls in the UI thread. Note that the wait handler isn't called when the result of a task is already available, so you can still call .get() on a completed task. This is completely optional and can be omitted if you don't need it.
| 54 | // completed task. This is completely optional and can be omitted if you don't |
| 55 | // need it. |
| 56 | void gtk_wait_handler(async::task_wait_handle) |
| 57 | { |
| 58 | std::cerr << "Error: Blocking wait in UI thread" << std::endl; |
| 59 | std::abort(); |
| 60 | } |
| 61 | |
| 62 | // Thread which increments the label value every ms |
| 63 | void label_update_thread(GtkLabel *label) |
nothing calls this directly
no outgoing calls
no test coverage detected