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

Side by Side Diff: base/synchronization/waitable_event.h

Issue 999753005: Make sure that WaitableEvent::TimedWait works fine with large timeouts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 5 years, 9 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 | base/synchronization/waitable_event_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_SYNCHRONIZATION_WAITABLE_EVENT_H_ 5 #ifndef BASE_SYNCHRONIZATION_WAITABLE_EVENT_H_
6 #define BASE_SYNCHRONIZATION_WAITABLE_EVENT_H_ 6 #define BASE_SYNCHRONIZATION_WAITABLE_EVENT_H_
7 7
8 #include "base/base_export.h" 8 #include "base/base_export.h"
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 10
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 // SendToOtherThread(e); 74 // SendToOtherThread(e);
75 // e->Wait(); 75 // e->Wait();
76 // delete e; 76 // delete e;
77 void Wait(); 77 void Wait();
78 78
79 // Wait up until max_time has passed for the event to be signaled. Returns 79 // Wait up until max_time has passed for the event to be signaled. Returns
80 // true if the event was signaled. If this method returns false, then it 80 // true if the event was signaled. If this method returns false, then it
81 // does not necessarily mean that max_time was exceeded. 81 // does not necessarily mean that max_time was exceeded.
82 // 82 //
83 // TimedWait can synchronise its own destruction like |Wait|. 83 // TimedWait can synchronise its own destruction like |Wait|.
84 //
85 // Passing a negative |max_time| is not supported.
84 bool TimedWait(const TimeDelta& max_time); 86 bool TimedWait(const TimeDelta& max_time);
85 87
86 #if defined(OS_WIN) 88 #if defined(OS_WIN)
87 HANDLE handle() const { return handle_.Get(); } 89 HANDLE handle() const { return handle_.Get(); }
88 #endif 90 #endif
89 91
90 // Wait, synchronously, on multiple events. 92 // Wait, synchronously, on multiple events.
91 // waitables: an array of WaitableEvent pointers 93 // waitables: an array of WaitableEvent pointers
92 // count: the number of elements in @waitables 94 // count: the number of elements in @waitables
93 // 95 //
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 179
178 scoped_refptr<WaitableEventKernel> kernel_; 180 scoped_refptr<WaitableEventKernel> kernel_;
179 #endif 181 #endif
180 182
181 DISALLOW_COPY_AND_ASSIGN(WaitableEvent); 183 DISALLOW_COPY_AND_ASSIGN(WaitableEvent);
182 }; 184 };
183 185
184 } // namespace base 186 } // namespace base
185 187
186 #endif // BASE_SYNCHRONIZATION_WAITABLE_EVENT_H_ 188 #endif // BASE_SYNCHRONIZATION_WAITABLE_EVENT_H_
OLDNEW
« no previous file with comments | « no previous file | base/synchronization/waitable_event_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698