OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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 NET_QUIC_PLATFORM_IMPL_QUIC_MUTEX_IMPL_H_ | 5 #ifndef NET_QUIC_PLATFORM_IMPL_QUIC_MUTEX_IMPL_H_ |
6 #define NET_QUIC_PLATFORM_IMPL_QUIC_MUTEX_IMPL_H_ | 6 #define NET_QUIC_PLATFORM_IMPL_QUIC_MUTEX_IMPL_H_ |
7 | 7 |
8 #include "base/synchronization/lock.h" | 8 #include "base/synchronization/lock.h" |
9 #include "net/quic/platform/api/quic_export.h" | 9 #include "net/quic/platform/api/quic_export.h" |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 #endif | 29 #endif |
30 | 30 |
31 #ifndef SCOPED_LOCKABLE | 31 #ifndef SCOPED_LOCKABLE |
32 #define SCOPED_LOCKABLE | 32 #define SCOPED_LOCKABLE |
33 #endif | 33 #endif |
34 | 34 |
35 #ifndef GUARDED_BY | 35 #ifndef GUARDED_BY |
36 #define GUARDED_BY(x) | 36 #define GUARDED_BY(x) |
37 #endif | 37 #endif |
38 | 38 |
| 39 #ifndef SHARED_LOCKS_REQUIRED |
| 40 #define SHARED_LOCKS_REQUIRED(...) |
| 41 #endif |
| 42 |
39 namespace net { | 43 namespace net { |
40 | 44 |
41 // A class wrapping a non-reentrant mutex. | 45 // A class wrapping a non-reentrant mutex. |
42 class QUIC_EXPORT_PRIVATE QuicLockImpl { | 46 class QUIC_EXPORT_PRIVATE QuicLockImpl { |
43 public: | 47 public: |
44 QuicLockImpl() = default; | 48 QuicLockImpl() = default; |
45 | 49 |
46 // Block until lock_ is free, then acquire it exclusively. | 50 // Block until lock_ is free, then acquire it exclusively. |
47 void WriterLock() EXCLUSIVE_LOCK_FUNCTION(); | 51 void WriterLock() EXCLUSIVE_LOCK_FUNCTION(); |
48 | 52 |
(...skipping 11 matching lines...) Expand all Loading... |
60 | 64 |
61 private: | 65 private: |
62 base::Lock lock_; | 66 base::Lock lock_; |
63 | 67 |
64 DISALLOW_COPY_AND_ASSIGN(QuicLockImpl); | 68 DISALLOW_COPY_AND_ASSIGN(QuicLockImpl); |
65 }; | 69 }; |
66 | 70 |
67 } // namespace net | 71 } // namespace net |
68 | 72 |
69 #endif // NET_QUIC_PLATFORM_IMPL_QUIC_MUTEX_IMPL_H_ | 73 #endif // NET_QUIC_PLATFORM_IMPL_QUIC_MUTEX_IMPL_H_ |
OLD | NEW |