diff --git a/runtime/bin/file_system_watcher_macos.cc b/runtime/bin/file_system_watcher_macos.cc index 6d51e9114ba..1ae1810f65d 100644 --- a/runtime/bin/file_system_watcher_macos.cc +++ b/runtime/bin/file_system_watcher_macos.cc @@ -136,7 +136,9 @@ class FSEventsWatcher { if (watcher == NULL) { watcher_monitor->Enter(); watcher = new FSEventsWatcher(); - watcher_monitor->Wait(Monitor::kNoTimeout); + while (watcher->run_loop_ == NULL) { + watcher_monitor->Wait(Monitor::kNoTimeout); + } watcher_monitor->Exit(); } watcher->users_++;