OLD | NEW |
---|---|
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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. Not supported for Windows builds. |
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) | 51 #if !defined(OS_WIN) |
52 OSLockType* os_lock() { return &os_lock_; } | 52 OSLockType* os_lock() { return &os_lock_; } |
53 #endif | 53 #endif |
54 | 54 |
55 private: | 55 private: |
56 #if defined(OS_MAC) && !defined(NDEBUG) | |
Mark Mentovai
2011/10/28 19:58:26
This won’t ever work. It’s OS_MACOSX.
You can add
eroman
2011/10/28 20:00:53
Thanks Mark!
I'll do that, and ping back once I h
| |
57 // Some instrumentation to help track down http://crbug.com/102161. Used to | |
58 // assert in debug builds when trying to use a freed lock. | |
59 enum LivenessToken { | |
60 LT_ALIVE = 0xCa11ab1e, | |
61 LT_DELETED = 0xDecea5ed, | |
62 }; | |
63 | |
64 void CheckIsAlive(); | |
65 | |
66 uint32 liveness_token_; | |
67 #endif | |
68 | |
56 OSLockType os_lock_; | 69 OSLockType os_lock_; |
57 | 70 |
58 DISALLOW_COPY_AND_ASSIGN(LockImpl); | 71 DISALLOW_COPY_AND_ASSIGN(LockImpl); |
59 }; | 72 }; |
60 | 73 |
61 } // namespace internal | 74 } // namespace internal |
62 } // namespace base | 75 } // namespace base |
63 | 76 |
64 #endif // BASE_SYNCHRONIZATION_LOCK_IMPL_H_ | 77 #endif // BASE_SYNCHRONIZATION_LOCK_IMPL_H_ |
OLD | NEW |