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

Side by Side Diff: base/synchronization/condition_variable_posix.cc

Issue 23753006: base: Rename OSLockType to NativeHandle in Lock API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | base/synchronization/condition_variable_win.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/synchronization/condition_variable.h" 5 #include "base/synchronization/condition_variable.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <sys/time.h> 8 #include <sys/time.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/synchronization/lock.h" 11 #include "base/synchronization/lock.h"
12 #include "base/threading/thread_restrictions.h" 12 #include "base/threading/thread_restrictions.h"
13 #include "base/time/time.h" 13 #include "base/time/time.h"
14 14
15 namespace base { 15 namespace base {
16 16
17 ConditionVariable::ConditionVariable(Lock* user_lock) 17 ConditionVariable::ConditionVariable(Lock* user_lock)
18 : user_mutex_(user_lock->lock_.os_lock()) 18 : user_mutex_(user_lock->lock_.native_handle())
19 #if !defined(NDEBUG) 19 #if !defined(NDEBUG)
20 , user_lock_(user_lock) 20 , user_lock_(user_lock)
21 #endif 21 #endif
22 { 22 {
23 int rv = pthread_cond_init(&condition_, NULL); 23 int rv = pthread_cond_init(&condition_, NULL);
24 DCHECK_EQ(0, rv); 24 DCHECK_EQ(0, rv);
25 } 25 }
26 26
27 ConditionVariable::~ConditionVariable() { 27 ConditionVariable::~ConditionVariable() {
28 int rv = pthread_cond_destroy(&condition_); 28 int rv = pthread_cond_destroy(&condition_);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 int rv = pthread_cond_broadcast(&condition_); 71 int rv = pthread_cond_broadcast(&condition_);
72 DCHECK_EQ(0, rv); 72 DCHECK_EQ(0, rv);
73 } 73 }
74 74
75 void ConditionVariable::Signal() { 75 void ConditionVariable::Signal() {
76 int rv = pthread_cond_signal(&condition_); 76 int rv = pthread_cond_signal(&condition_);
77 DCHECK_EQ(0, rv); 77 DCHECK_EQ(0, rv);
78 } 78 }
79 79
80 } // namespace base 80 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/synchronization/condition_variable_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698