mirror of
https://github.com/intel/llvm.git
synced 2026-01-19 01:15:50 +08:00
sanitizer_common: revert StaticSpinMutex ctor
Patch "sanitizer_common: modernize SpinMutex" added default ctor to StaticSpinMutex. But it broke some gcc bots with: scudo_tsd_exclusive.cpp:25:22: error: non-local variable ‘__scudo::TSD’ declared ‘__thread’ needs dynamic initialization https://lab.llvm.org/buildbot/#/builders/105/builds/12649 Unfortunatly none of empty ctor {}, no ctor, default constexpr ctor work for different reasons. So remove StaticSpinMutex ctor entirely and move deleted copy ctor back to SpinMutex. Differential Revision: https://reviews.llvm.org/D106424
This commit is contained in:
@@ -22,8 +22,6 @@ namespace __sanitizer {
|
||||
|
||||
class MUTEX StaticSpinMutex {
|
||||
public:
|
||||
StaticSpinMutex() = default;
|
||||
|
||||
void Init() {
|
||||
atomic_store(&state_, 0, memory_order_relaxed);
|
||||
}
|
||||
@@ -48,9 +46,6 @@ class MUTEX StaticSpinMutex {
|
||||
atomic_uint8_t state_;
|
||||
|
||||
void LockSlow();
|
||||
|
||||
StaticSpinMutex(const StaticSpinMutex &) = delete;
|
||||
void operator=(const StaticSpinMutex &) = delete;
|
||||
};
|
||||
|
||||
class MUTEX SpinMutex : public StaticSpinMutex {
|
||||
@@ -58,6 +53,9 @@ class MUTEX SpinMutex : public StaticSpinMutex {
|
||||
SpinMutex() {
|
||||
Init();
|
||||
}
|
||||
|
||||
SpinMutex(const SpinMutex &) = delete;
|
||||
void operator=(const SpinMutex &) = delete;
|
||||
};
|
||||
|
||||
// Semaphore provides an OS-dependent way to park/unpark threads.
|
||||
|
||||
Reference in New Issue
Block a user