Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions compiler-rt/lib/sanitizer_common/sanitizer_mutex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,10 @@ struct InternalDeadlockDetector {
return initialized > 0;
}
};

static THREADLOCAL InternalDeadlockDetector deadlock_detector;
// This variable is used by the __tls_get_addr interceptor, so cannot use the
// global-dynamic TLS model, as that would result in crashes.
__attribute__((tls_model("initial-exec"))) static THREADLOCAL
InternalDeadlockDetector deadlock_detector;

void CheckedMutex::LockImpl(uptr pc) { deadlock_detector.Lock(type_, pc); }

Expand Down