ui_bridge: Fix race condition that results in deadlock.

Fixed by waiting until the UI thread finishes processing events. Close #3541.
This commit is contained in:
Thiago de Arruda
2015-10-31 07:36:08 -03:00
parent ef1d39bbbf
commit 0dac666098
3 changed files with 23 additions and 1 deletions

View File

@@ -22,6 +22,10 @@ struct ui_bridge_data {
// the call returns. This flag is used as a condition for the main
// thread to continue.
bool ready;
// When a stop request is sent from the main thread, it must wait until the UI
// thread finishes handling all events. This flag is set by the UI thread as a
// signal that it will no longer send messages to the main thread.
bool stopped;
};
#define CONTINUE(b) \