diff options
author | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-24 19:29:27 +0000 |
---|---|---|
committer | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-24 19:29:27 +0000 |
commit | 5bde6d1668fe077024c99cecfce09cb6bd4a67ee (patch) | |
tree | 6b2f67a32bc104888f11bf30393b3232efd29494 /chrome/common/service_process_util_posix.h | |
parent | 9091fb63ab0a815870f6731dd6113e17c59c093e (diff) | |
download | chromium_src-5bde6d1668fe077024c99cecfce09cb6bd4a67ee.zip chromium_src-5bde6d1668fe077024c99cecfce09cb6bd4a67ee.tar.gz chromium_src-5bde6d1668fe077024c99cecfce09cb6bd4a67ee.tar.bz2 |
Fixes up the race condition that exists with deleting a file vs watching it.
The tests created a file and attempted to hook a watcher on it on a separate thread
but it was deleting it before the thread had a chance to watch it.
BUG=77217,77064, 69641
TEST=BUILD
Review URL: http://codereview.chromium.org/6676118
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79307 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/service_process_util_posix.h')
-rw-r--r-- | chrome/common/service_process_util_posix.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/chrome/common/service_process_util_posix.h b/chrome/common/service_process_util_posix.h index d053de4..ba12920 100644 --- a/chrome/common/service_process_util_posix.h +++ b/chrome/common/service_process_util_posix.h @@ -29,6 +29,10 @@ CFDictionaryRef CreateServiceProcessLaunchdPlist(CommandLine* cmd_line, bool for_auto_launch); #endif // OS_MACOSX +namespace base { +class WaitableEvent; +} + // Watches for |kShutDownMessage| to be written to the file descriptor it is // watching. When it reads |kShutDownMessage|, it performs |shutdown_task_|. // Used here to monitor the socket listening to g_signal_socket. @@ -57,7 +61,7 @@ struct ServiceProcessState::StateData // WatchFileDescriptor needs to be set up by the thread that is going // to be monitoring it. - void SignalReady(); + void SignalReady(base::WaitableEvent* signal, bool* success); // TODO(jhawkins): Either make this a class or rename these public member |