@@ -46,30 +46,6 @@ LEAVE_CRITICAL_SECTION(mutex); // no RAII
46
46
// //
47
47
// /////////////////////////////
48
48
49
- /* *
50
- * Template mixin that adds -Wthread-safety locking
51
- * annotations to a subset of the mutex API.
52
- */
53
- template <typename PARENT>
54
- class LOCKABLE AnnotatedMixin : public PARENT
55
- {
56
- public:
57
- void lock () EXCLUSIVE_LOCK_FUNCTION()
58
- {
59
- PARENT::lock ();
60
- }
61
-
62
- void unlock () UNLOCK_FUNCTION()
63
- {
64
- PARENT::unlock ();
65
- }
66
-
67
- bool try_lock () EXCLUSIVE_TRYLOCK_FUNCTION(true )
68
- {
69
- return PARENT::try_lock ();
70
- }
71
- };
72
-
73
49
#ifdef DEBUG_LOCKORDER
74
50
void EnterCritical (const char * pszName, const char * pszFile, int nLine, void * cs, bool fTry = false );
75
51
void LeaveCritical ();
@@ -94,6 +70,30 @@ void static inline DeleteLock(void* cs) {}
94
70
#define AssertLockHeld (cs ) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
95
71
#define AssertLockNotHeld (cs ) AssertLockNotHeldInternal(#cs, __FILE__, __LINE__, &cs)
96
72
73
+ /* *
74
+ * Template mixin that adds -Wthread-safety locking
75
+ * annotations to a subset of the mutex API.
76
+ */
77
+ template <typename PARENT>
78
+ class LOCKABLE AnnotatedMixin : public PARENT
79
+ {
80
+ public:
81
+ void lock () EXCLUSIVE_LOCK_FUNCTION()
82
+ {
83
+ PARENT::lock ();
84
+ }
85
+
86
+ void unlock () UNLOCK_FUNCTION()
87
+ {
88
+ PARENT::unlock ();
89
+ }
90
+
91
+ bool try_lock () EXCLUSIVE_TRYLOCK_FUNCTION(true )
92
+ {
93
+ return PARENT::try_lock ();
94
+ }
95
+ };
96
+
97
97
/* *
98
98
* Wrapped mutex: supports recursive locking, but no waiting
99
99
* TODO: We should move away from using the recursive lock by default.
0 commit comments