Chromium Code Reviews| 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 "base/base_api.h" | |
| 10 #include "base/basictypes.h" | |
|
rvargas (doing something else)
2011/04/28 23:29:43
I think we still want these to go after the os dep
Evan Martin
2011/04/28 23:39:40
There was some thread on chromium-dev where we dec
rvargas (doing something else)
2011/04/28 23:45:31
Yes, that same thread mentioned this exception (al
| |
| 9 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 10 | 12 |
| 11 #if defined(OS_WIN) | 13 #if defined(OS_WIN) |
| 12 #include <windows.h> | 14 #include <windows.h> |
| 13 #elif defined(OS_POSIX) | 15 #elif defined(OS_POSIX) |
| 14 #include <pthread.h> | 16 #include <pthread.h> |
| 15 #endif | 17 #endif |
| 16 | 18 |
| 17 #include "base/basictypes.h" | |
| 18 | |
| 19 namespace base { | 19 namespace base { |
| 20 namespace internal { | 20 namespace internal { |
| 21 | 21 |
| 22 // This class implements the underlying platform-specific spin-lock mechanism | 22 // This class implements the underlying platform-specific spin-lock mechanism |
| 23 // used for the Lock class. Most users should not use LockImpl directly, but | 23 // used for the Lock class. Most users should not use LockImpl directly, but |
| 24 // should instead use Lock. | 24 // should instead use Lock. |
| 25 class LockImpl { | 25 class BASE_API LockImpl { |
|
rvargas (doing something else)
2011/04/28 23:29:43
Why do we need to export this? It should not be us
Evan Martin
2011/04/28 23:39:40
Lock::~Lock() is inlined, and it calls LockImpl::~
| |
| 26 public: | 26 public: |
| 27 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
| 28 typedef CRITICAL_SECTION OSLockType; | 28 typedef CRITICAL_SECTION OSLockType; |
| 29 #elif defined(OS_POSIX) | 29 #elif defined(OS_POSIX) |
| 30 typedef pthread_mutex_t OSLockType; | 30 typedef pthread_mutex_t OSLockType; |
| 31 #endif | 31 #endif |
| 32 | 32 |
| 33 LockImpl(); | 33 LockImpl(); |
| 34 ~LockImpl(); | 34 ~LockImpl(); |
| 35 | 35 |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 54 private: | 54 private: |
| 55 OSLockType os_lock_; | 55 OSLockType os_lock_; |
| 56 | 56 |
| 57 DISALLOW_COPY_AND_ASSIGN(LockImpl); | 57 DISALLOW_COPY_AND_ASSIGN(LockImpl); |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 } // namespace internal | 60 } // namespace internal |
| 61 } // namespace base | 61 } // namespace base |
| 62 | 62 |
| 63 #endif // BASE_SYNCHRONIZATION_LOCK_IMPL_H_ | 63 #endif // BASE_SYNCHRONIZATION_LOCK_IMPL_H_ |
| OLD | NEW |