[android] Fix issue when stop is called before run on the RunLoop

The current ::stop() implementation was not thread safe and we
should queue the ::stop() for the next loop iteration so even
if we call ::stop() before ::run(), it gets processed.
This commit is contained in:
Thiago Marcos P. Santos
2016-07-05 18:01:05 +03:00
parent 13cd75f099
commit dfd0b105cd

View File

@@ -211,8 +211,10 @@ void RunLoop::runOnce() {
}
void RunLoop::stop() {
impl->running = false;
impl->wake();
invoke([&] {
impl->running = false;
impl->wake();
});
}
void RunLoop::addWatch(int, Event, std::function<void(int, Event)>&&) {