Fix deadlock in tests

This commit is contained in:
Leith Bade
2014-12-02 22:13:31 +11:00
parent 0935cef9c3
commit 6bfc6a2b10

View File

@@ -278,15 +278,21 @@ void Map::run() {
#endif
assert(uv_thread_self() == map_thread);
check_for_pause();
if (async) {
check_for_pause();
}
setup();
prepare();
terminating = false;
while(!terminating) {
if (async) {
terminating = false;
while(!terminating) {
uv_run(**loop, UV_RUN_DEFAULT);
check_for_pause();
}
} else {
uv_run(**loop, UV_RUN_DEFAULT);
check_for_pause();
}
// Run the event loop once more to make sure our async delete handlers are called.