aboutsummaryrefslogtreecommitdiff
path: root/src/sync.h
diff options
context:
space:
mode:
authorPhilip Kaufmann <phil.kaufmann@t-online.de>2015-03-13 08:14:50 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-04-20 13:29:21 +0200
commit71ad6bd38b0f3854a03d69c0bf3e83a1e4d95a56 (patch)
tree83931dbf1ddf7a0578a6bfcbab6a67a9df59c9e5 /src/sync.h
parentabcec3082e4eb3d91ada6144090d7f1ea46b7d3c (diff)
downloadbitcoin-71ad6bd38b0f3854a03d69c0bf3e83a1e4d95a56.tar.xz
[Trivial] format sync.h
Diffstat (limited to 'src/sync.h')
-rw-r--r--src/sync.h23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/sync.h b/src/sync.h
index 27e80e813b..78b9043477 100644
--- a/src/sync.h
+++ b/src/sync.h
@@ -21,9 +21,6 @@
////////////////////////////////////////////////
/*
-
-
-
CCriticalSection mutex;
boost::recursive_mutex mutex;
@@ -42,20 +39,18 @@ ENTER_CRITICAL_SECTION(mutex); // no RAII
LEAVE_CRITICAL_SECTION(mutex); // no RAII
mutex.unlock();
-
-
-
*/
-
///////////////////////////////
// //
// THE ACTUAL IMPLEMENTATION //
// //
///////////////////////////////
-// Template mixin that adds -Wthread-safety locking annotations to a
-// subset of the mutex API.
+/**
+ * Template mixin that adds -Wthread-safety locking
+ * annotations to a subset of the mutex API.
+ */
template <typename PARENT>
class LOCKABLE AnnotatedMixin : public PARENT
{
@@ -76,8 +71,10 @@ public:
}
};
-/** Wrapped boost mutex: supports recursive locking, but no waiting */
-// TODO: We should move away from using the recursive lock by default.
+/**
+ * Wrapped boost mutex: supports recursive locking, but no waiting
+ * TODO: We should move away from using the recursive lock by default.
+ */
typedef AnnotatedMixin<boost::recursive_mutex> CCriticalSection;
/** Wrapped boost mutex: supports waiting but not recursive locking */
@@ -92,9 +89,7 @@ void LeaveCritical();
std::string LocksHeld();
void AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, void* cs);
#else
-void static inline EnterCritical(const char* pszName, const char* pszFile, int nLine, void* cs, bool fTry = false)
-{
-}
+void static inline EnterCritical(const char* pszName, const char* pszFile, int nLine, void* cs, bool fTry = false) {}
void static inline LeaveCritical() {}
void static inline AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, void* cs) {}
#endif