Use while(condition) around monitor wait, in file_system_watcher_macos.

This fixes a potential threading-issue, where the wacther could be used before it was fully initialized, if 'wait' woke up before notify.

BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//39713002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29163 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
ajohnsen@google.com
2013-10-24 10:24:08 +00:00
parent 581fa005f9
commit 33daee971b
+3 -1
View File
@@ -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_++;