Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: base/waitable_event.h

Issue 18324: POSIX: Get IPCSyncChannel unittests working (Closed)
Patch Set: Addressing comments Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/common/child_process.cc » ('j') | chrome/common/ipc_sync_channel.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_WAITABLE_EVENT_H_ 5 #ifndef BASE_WAITABLE_EVENT_H_
6 #define BASE_WAITABLE_EVENT_H_ 6 #define BASE_WAITABLE_EVENT_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 9
10 #if defined(OS_WIN) 10 #if defined(OS_WIN)
11 #include <windows.h> 11 #include <windows.h>
12 #endif 12 #endif
13 13
14 #if defined(OS_POSIX) 14 #if defined(OS_POSIX)
15 #include <list> 15 #include <list>
16 #include <utility> 16 #include <utility>
17 #include "base/condition_variable.h" 17 #include "base/condition_variable.h"
18 #include "base/lock.h" 18 #include "base/lock.h"
19 #include "base/ref_counted.h" 19 #include "base/ref_counted.h"
20 #endif 20 #endif
21 21
22 #include "base/message_loop.h" 22 #include "base/message_loop.h"
23 23
24 namespace base { 24 namespace base {
25 25
26 // This replaces INFINITE from Win32
27 static const int kNoTimeout = -1;
28
26 class TimeDelta; 29 class TimeDelta;
27 30
28 // A WaitableEvent can be a useful thread synchronization tool when you want to 31 // A WaitableEvent can be a useful thread synchronization tool when you want to
29 // allow one thread to wait for another thread to finish some work. For 32 // allow one thread to wait for another thread to finish some work. For
30 // non-Windows systems, this can only be used from within a single address 33 // non-Windows systems, this can only be used from within a single address
31 // space. 34 // space.
32 // 35 //
33 // Use a WaitableEvent when you would otherwise use a Lock+ConditionVariable to 36 // Use a WaitableEvent when you would otherwise use a Lock+ConditionVariable to
34 // protect a simple boolean value. However, if you find yourself using a 37 // protect a simple boolean value. However, if you find yourself using a
35 // WaitableEvent in conjunction with a Lock to wait for a more complex state 38 // WaitableEvent in conjunction with a Lock to wait for a more complex state
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 const bool manual_reset_; 147 const bool manual_reset_;
145 std::list<Waiter*> waiters_; 148 std::list<Waiter*> waiters_;
146 #endif 149 #endif
147 150
148 DISALLOW_COPY_AND_ASSIGN(WaitableEvent); 151 DISALLOW_COPY_AND_ASSIGN(WaitableEvent);
149 }; 152 };
150 153
151 } // namespace base 154 } // namespace base
152 155
153 #endif // BASE_WAITABLE_EVENT_H_ 156 #endif // BASE_WAITABLE_EVENT_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/common/child_process.cc » ('j') | chrome/common/ipc_sync_channel.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698