summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_thread_registry.h
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2013-03-19 12:25:48 +0000
committerDmitry Vyukov <dvyukov@google.com>2013-03-19 12:25:48 +0000
commitce85e03620f64ce7e4cd0598f2e93090f52a9e99 (patch)
tree16b43363033c32c949b7b187e5d6cbe23219e1b0 /lib/sanitizer_common/sanitizer_thread_registry.h
parent8e1c769ed84f4d5cf23904dee1abeec6f125f1ac (diff)
tsan: flush dead thread info earlier (when another thread is finished rather than new thread is created)
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177394 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_thread_registry.h')
-rw-r--r--lib/sanitizer_common/sanitizer_thread_registry.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/sanitizer_common/sanitizer_thread_registry.h b/lib/sanitizer_common/sanitizer_thread_registry.h
index e2ee8f82d..66eb4ca18 100644
--- a/lib/sanitizer_common/sanitizer_thread_registry.h
+++ b/lib/sanitizer_common/sanitizer_thread_registry.h
@@ -60,7 +60,7 @@ class ThreadContextBase {
void SetStarted(uptr _os_id, void *arg);
void SetCreated(uptr _user_id, u64 _unique_id, bool _detached,
u32 _parent_tid, void *arg);
- void Reset(void *arg);
+ void Reset();
// The following methods may be overriden by subclasses.
// Some of them take opaque arg that may be optionally be used
@@ -70,7 +70,7 @@ class ThreadContextBase {
virtual void OnFinished() {}
virtual void OnStarted(void *arg) {}
virtual void OnCreated(void *arg) {}
- virtual void OnReset(void *arg) {}
+ virtual void OnReset() {}
};
typedef ThreadContextBase* (*ThreadContextFactory)(u32 tid);
@@ -133,6 +133,10 @@ class ThreadRegistry {
ThreadContextBase **threads_; // Array of thread contexts is leaked.
IntrusiveList<ThreadContextBase> dead_threads_;
+ IntrusiveList<ThreadContextBase> invalid_threads_;
+
+ void QuarantinePush(ThreadContextBase *tctx);
+ ThreadContextBase *QuarantinePop();
};
typedef GenericScopedLock<ThreadRegistry> ThreadRegistryLock;