karelpeeters
08/13/2017, 7:16 AMSyncronizedQueue<Event> for the events, and just call poll() on it in the while loop, it will automatically wait until there are events and call put(event) when there's a new even, it will automatically resume the main loop.