+ // release the GUI mutex so that other threads have a chance to post
+ // events:
+ wxMutexGuiLeave();
+
+ bool rv = ms_buffer->WaitForEventWithTimeout(0, TIMEOUT);
+
+ // and acquire it back before calling any event handlers:
+ wxMutexGuiEnter();
+
+ if ( rv )