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

Side by Side Diff: base/waitable_event_posix.cc

Issue 18288: GCC on the buildbots is more picky (Closed)
Patch Set: 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 | no next file » | 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) 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 #include "base/waitable_event.h" 5 #include "base/waitable_event.h"
6 6
7 #include "base/condition_variable.h" 7 #include "base/condition_variable.h"
8 #include "base/lock.h" 8 #include "base/lock.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 10
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 if (sw.fired()) 264 if (sw.fired())
265 break; 265 break;
266 266
267 cv.Wait(); 267 cv.Wait();
268 } 268 }
269 lock.Release(); 269 lock.Release();
270 270
271 // The address of the WaitableEvent which fired is stored in the SyncWaiter. 271 // The address of the WaitableEvent which fired is stored in the SyncWaiter.
272 WaitableEvent *const signaled_event = sw.signaled_event(); 272 WaitableEvent *const signaled_event = sw.signaled_event();
273 // This will store the index of the raw_waitables which fired. 273 // This will store the index of the raw_waitables which fired.
274 size_t signaled_index; 274 size_t signaled_index = 0;
275 275
276 // Take the locks of each WaitableEvent in turn (except the signaled one) and 276 // Take the locks of each WaitableEvent in turn (except the signaled one) and
277 // remove our SyncWaiter from the wait-list 277 // remove our SyncWaiter from the wait-list
278 for (size_t i = 0; i < count; ++i) { 278 for (size_t i = 0; i < count; ++i) {
279 if (raw_waitables[i] != signaled_event) { 279 if (raw_waitables[i] != signaled_event) {
280 raw_waitables[i]->lock_.Acquire(); 280 raw_waitables[i]->lock_.Acquire();
281 // There's no possible ABA issue with the address of the SyncWaiter here 281 // There's no possible ABA issue with the address of the SyncWaiter here
282 // because it lives on the stack. Thus the tag value is just the pointer 282 // because it lives on the stack. Thus the tag value is just the pointer
283 // value again. 283 // value again.
284 raw_waitables[i]->Dequeue(&sw, &sw); 284 raw_waitables[i]->Dequeue(&sw, &sw);
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 return true; 383 return true;
384 } 384 }
385 } 385 }
386 386
387 return false; 387 return false;
388 } 388 }
389 389
390 // ----------------------------------------------------------------------------- 390 // -----------------------------------------------------------------------------
391 391
392 } // namespace base 392 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698