mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-25 22:41:36 +02:00
threading: remove obsolete critsect macros
This commit is contained in:
20
src/sync.h
20
src/sync.h
@@ -39,12 +39,6 @@ LOCK2(mutex1, mutex2);
|
||||
|
||||
TRY_LOCK(mutex, name);
|
||||
std::unique_lock<std::recursive_mutex> name(mutex, std::try_to_lock_t);
|
||||
|
||||
ENTER_CRITICAL_SECTION(mutex); // no RAII
|
||||
mutex.lock();
|
||||
|
||||
LEAVE_CRITICAL_SECTION(mutex); // no RAII
|
||||
mutex.unlock();
|
||||
*/
|
||||
|
||||
///////////////////////////////
|
||||
@@ -270,20 +264,6 @@ inline MutexType* MaybeCheckNotHeld(MutexType* m) LOCKS_EXCLUDED(m) LOCK_RETURNE
|
||||
#define TRY_LOCK(cs, name) UniqueLock name(LOCK_ARGS(cs), true)
|
||||
#define WAIT_LOCK(cs, name) UniqueLock name(LOCK_ARGS(cs))
|
||||
|
||||
#define ENTER_CRITICAL_SECTION(cs) \
|
||||
{ \
|
||||
EnterCritical(#cs, __FILE__, __LINE__, &cs); \
|
||||
(cs).lock(); \
|
||||
}
|
||||
|
||||
#define LEAVE_CRITICAL_SECTION(cs) \
|
||||
{ \
|
||||
std::string lockname; \
|
||||
CheckLastCritical((void*)(&cs), lockname, #cs, __FILE__, __LINE__); \
|
||||
(cs).unlock(); \
|
||||
LeaveCritical(); \
|
||||
}
|
||||
|
||||
//! Run code while locking a mutex.
|
||||
//!
|
||||
//! Examples:
|
||||
|
Reference in New Issue
Block a user