File tree 3 files changed +11
-11
lines changed
3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ static int FileWriteStr(const std::string &str, FILE *fp)
41
41
42
42
bool BCLog::Logger::StartLogging ()
43
43
{
44
- LockGuard scoped_lock (m_cs);
44
+ StdLockGuard scoped_lock (m_cs);
45
45
46
46
assert (m_buffering);
47
47
assert (m_fileout == nullptr );
@@ -80,7 +80,7 @@ bool BCLog::Logger::StartLogging()
80
80
81
81
void BCLog::Logger::DisconnectTestLogger ()
82
82
{
83
- LockGuard scoped_lock (m_cs);
83
+ StdLockGuard scoped_lock (m_cs);
84
84
m_buffering = true ;
85
85
if (m_fileout != nullptr ) fclose (m_fileout);
86
86
m_fileout = nullptr ;
@@ -246,7 +246,7 @@ namespace BCLog {
246
246
247
247
void BCLog::Logger::LogPrintStr (const std::string& str)
248
248
{
249
- LockGuard scoped_lock (m_cs);
249
+ StdLockGuard scoped_lock (m_cs);
250
250
std::string str_prefixed = LogEscapeMessage (str);
251
251
252
252
if (m_log_threadnames && m_started_new_line) {
Original file line number Diff line number Diff line change @@ -100,22 +100,22 @@ namespace BCLog {
100
100
/* * Returns whether logs will be written to any output */
101
101
bool Enabled () const
102
102
{
103
- LockGuard scoped_lock (m_cs);
103
+ StdLockGuard scoped_lock (m_cs);
104
104
return m_buffering || m_print_to_console || m_print_to_file || !m_print_callbacks.empty ();
105
105
}
106
106
107
107
/* * Connect a slot to the print signal and return the connection */
108
108
std::list<std::function<void (const std::string&)>>::iterator PushBackCallback (std::function<void (const std::string&)> fun)
109
109
{
110
- LockGuard scoped_lock (m_cs);
110
+ StdLockGuard scoped_lock (m_cs);
111
111
m_print_callbacks.push_back (std::move (fun));
112
112
return --m_print_callbacks.end ();
113
113
}
114
114
115
115
/* * Delete a connection */
116
116
void DeleteCallback (std::list<std::function<void (const std::string&)>>::iterator it)
117
117
{
118
- LockGuard scoped_lock (m_cs);
118
+ StdLockGuard scoped_lock (m_cs);
119
119
m_print_callbacks.erase (it);
120
120
}
121
121
Original file line number Diff line number Diff line change @@ -62,13 +62,13 @@ class LOCKABLE StdMutex : public std::mutex
62
62
{
63
63
};
64
64
65
- // LockGuard provides an annotated version of lock_guard for us
66
- // should only be used when sync.h Mutex/LOCK/etc aren't usable
67
- class SCOPED_LOCKABLE LockGuard : public std::lock_guard<StdMutex>
65
+ // StdLockGuard provides an annotated version of std:: lock_guard for us,
66
+ // and should only be used when sync.h Mutex/LOCK/etc are not usable.
67
+ class SCOPED_LOCKABLE StdLockGuard : public std::lock_guard<StdMutex>
68
68
{
69
69
public:
70
- explicit LockGuard (StdMutex& cs) EXCLUSIVE_LOCK_FUNCTION(cs) : std::lock_guard<StdMutex>(cs) {}
71
- ~LockGuard () UNLOCK_FUNCTION() {};
70
+ explicit StdLockGuard (StdMutex& cs) EXCLUSIVE_LOCK_FUNCTION(cs) : std::lock_guard<StdMutex>(cs) {}
71
+ ~StdLockGuard () UNLOCK_FUNCTION() {}
72
72
};
73
73
74
74
#endif // BITCOIN_THREADSAFETY_H
You can’t perform that action at this time.
0 commit comments