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

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

Issue 8953003: Condition variable implementation for vista, win7 (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years 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 | « base/synchronization/lock.h ('k') | 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) 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 #ifndef BASE_SYNCHRONIZATION_LOCK_IMPL_H_ 5 #ifndef BASE_SYNCHRONIZATION_LOCK_IMPL_H_
6 #define BASE_SYNCHRONIZATION_LOCK_IMPL_H_ 6 #define BASE_SYNCHRONIZATION_LOCK_IMPL_H_
7 #pragma once 7 #pragma once
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 10
(...skipping 27 matching lines...) Expand all
38 // held by something else, immediately return false. 38 // held by something else, immediately return false.
39 bool Try(); 39 bool Try();
40 40
41 // Take the lock, blocking until it is available if necessary. 41 // Take the lock, blocking until it is available if necessary.
42 void Lock(); 42 void Lock();
43 43
44 // Release the lock. This must only be called by the lock's holder: after 44 // Release the lock. This must only be called by the lock's holder: after
45 // a successful call to Try, or a call to Lock. 45 // a successful call to Try, or a call to Lock.
46 void Unlock(); 46 void Unlock();
47 47
48 // Return the native underlying lock. Not supported for Windows builds. 48 // Return the native underlying lock.
49 // TODO(awalker): refactor lock and condition variables so that this is 49 // TODO(awalker): refactor lock and condition variables so that this is
50 // unnecessary. 50 // unnecessary.
51 #if !defined(OS_WIN)
52 OSLockType* os_lock() { return &os_lock_; } 51 OSLockType* os_lock() { return &os_lock_; }
53 #endif
54 52
55 private: 53 private:
56 OSLockType os_lock_; 54 OSLockType os_lock_;
57 55
58 DISALLOW_COPY_AND_ASSIGN(LockImpl); 56 DISALLOW_COPY_AND_ASSIGN(LockImpl);
59 }; 57 };
60 58
61 } // namespace internal 59 } // namespace internal
62 } // namespace base 60 } // namespace base
63 61
64 #endif // BASE_SYNCHRONIZATION_LOCK_IMPL_H_ 62 #endif // BASE_SYNCHRONIZATION_LOCK_IMPL_H_
OLDNEW
« no previous file with comments | « base/synchronization/lock.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698