File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ namespace BCLog {
62
62
class Logger
63
63
{
64
64
private:
65
- mutable std::mutex m_cs; // Can not use Mutex from sync.h because in debug mode it would cause a deadlock when a potential deadlock was detected
65
+ mutable StdMutex m_cs; // Can not use Mutex from sync.h because in debug mode it would cause a deadlock when a potential deadlock was detected
66
66
67
67
FILE* m_fileout GUARDED_BY (m_cs) = nullptr;
68
68
std::list<std::string> m_msgs_before_open GUARDED_BY (m_cs);
Original file line number Diff line number Diff line change 56
56
#define ASSERT_EXCLUSIVE_LOCK (...)
57
57
#endif // __GNUC__
58
58
59
+ // StdMutex provides an annotated version of std::mutex for us,
60
+ // and should only be used when sync.h Mutex/LOCK/etc are not usable.
61
+ class LOCKABLE StdMutex : public std::mutex
62
+ {
63
+ };
64
+
59
65
// LockGuard provides an annotated version of lock_guard for us
60
66
// should only be used when sync.h Mutex/LOCK/etc aren't usable
61
- class SCOPED_LOCKABLE LockGuard : public std::lock_guard<std::mutex >
67
+ class SCOPED_LOCKABLE LockGuard : public std::lock_guard<StdMutex >
62
68
{
63
69
public:
64
- explicit LockGuard (std::mutex & cs) EXCLUSIVE_LOCK_FUNCTION(cs) : std::lock_guard<std::mutex >(cs) { }
70
+ explicit LockGuard (StdMutex & cs) EXCLUSIVE_LOCK_FUNCTION(cs) : std::lock_guard<StdMutex >(cs) {}
65
71
~LockGuard () UNLOCK_FUNCTION() {};
66
72
};
67
73
You can’t perform that action at this time.
0 commit comments