| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // A mutex class, with support for thread annotations. | 5 // A mutex class, with support for thread annotations. |
| 6 // | 6 // |
| 7 // TODO(vtl): Currently, this is a fork of Chromium's | 7 // TODO(vtl): Currently, this is a fork of Chromium's |
| 8 // base/synchronization/lock.h (with names changed and minor modifications; it | 8 // base/synchronization/lock.h (with names changed and minor modifications; it |
| 9 // still cheats and uses Chromium's lock_impl.*), but eventually we'll want our | 9 // still cheats and uses Chromium's lock_impl.*), but eventually we'll want our |
| 10 // own and, e.g., add support for non-exclusive (reader) locks. | 10 // own and, e.g., add support for non-exclusive (reader) locks. |
| 11 | 11 |
| 12 #ifndef THIRD_PARTY_MOJO_SRC_MOJO_EDK_SYSTEM_MUTEX_H_ | 12 #ifndef THIRD_PARTY_MOJO_SRC_MOJO_EDK_SYSTEM_MUTEX_H_ |
| 13 #define THIRD_PARTY_MOJO_SRC_MOJO_EDK_SYSTEM_MUTEX_H_ | 13 #define THIRD_PARTY_MOJO_SRC_MOJO_EDK_SYSTEM_MUTEX_H_ |
| 14 | 14 |
| 15 #include "base/synchronization/lock_impl.h" | 15 #include "base/synchronization/lock_impl.h" |
| 16 #include "base/threading/platform_thread.h" | 16 #include "base/threading/platform_thread.h" |
| 17 #include "mojo/public/cpp/system/macros.h" | |
| 18 #include "third_party/mojo/src/mojo/edk/system/system_impl_export.h" | 17 #include "third_party/mojo/src/mojo/edk/system/system_impl_export.h" |
| 19 #include "third_party/mojo/src/mojo/edk/system/thread_annotations.h" | 18 #include "third_party/mojo/src/mojo/edk/system/thread_annotations.h" |
| 19 #include "third_party/mojo/src/mojo/public/cpp/system/macros.h" |
| 20 | 20 |
| 21 namespace mojo { | 21 namespace mojo { |
| 22 namespace system { | 22 namespace system { |
| 23 | 23 |
| 24 // Mutex ----------------------------------------------------------------------- | 24 // Mutex ----------------------------------------------------------------------- |
| 25 | 25 |
| 26 class MOJO_LOCKABLE MOJO_SYSTEM_IMPL_EXPORT Mutex { | 26 class MOJO_LOCKABLE MOJO_SYSTEM_IMPL_EXPORT Mutex { |
| 27 public: | 27 public: |
| 28 #if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON) | 28 #if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON) |
| 29 Mutex() : lock_() {} | 29 Mutex() : lock_() {} |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 private: | 84 private: |
| 85 Mutex* const mutex_; | 85 Mutex* const mutex_; |
| 86 | 86 |
| 87 MOJO_DISALLOW_COPY_AND_ASSIGN(MutexLocker); | 87 MOJO_DISALLOW_COPY_AND_ASSIGN(MutexLocker); |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 } // namespace system | 90 } // namespace system |
| 91 } // namespace mojo | 91 } // namespace mojo |
| 92 | 92 |
| 93 #endif // THIRD_PARTY_MOJO_SRC_MOJO_EDK_SYSTEM_MUTEX_H_ | 93 #endif // THIRD_PARTY_MOJO_SRC_MOJO_EDK_SYSTEM_MUTEX_H_ |
| OLD | NEW |