Home | History | Annotate | Download | only in tsan

Lines Matching refs:Thread

208 // Thread ID.
292 static void ForgetAllStateAndStartOver(Thread *thr, const char *reason);
293 static void FlushStateIfOutOfSegments(Thread *thr);
294 static int32_t raw_tid(Thread *t);
2517 // The new segment is in the same thread - just replace the SID.
2522 // The new segment is in another thread, but old segment
2636 // we have another segment from the same thread => replace it.
3292 INLINE CacheLine *TryAcquireLine(Thread *thr, uintptr_t a, int call_site) {
3314 INLINE CacheLine *AcquireLine(Thread *thr, uintptr_t a, int call_site) {
3340 INLINE void ReleaseLine(Thread *thr, uintptr_t a, CacheLine *line, int call_site) {
3361 void AcquireAllLines(Thread *thr) {
3375 INLINE CacheLine *GetLine(Thread *thr, uintptr_t a, bool create_new_if_need, int call_site) {
3419 INLINE CacheLine *GetLineOrCreateNew(Thread *thr, uintptr_t a, int call_site) {
3422 INLINE CacheLine *GetLineIfExists(Thread *thr, uintptr_t a, int call_site) {
3426 void ForgetAllState(Thread *thr) {
3511 NOINLINE CacheLine *WriteBackAndFetch(Thread *thr, CacheLine *old_line,
3715 static void PublishRangeInOneLine(Thread *thr, uintptr_t addr, uintptr_t a,
3747 static void PublishRange(Thread *thr, uintptr_t a, uintptr_t b, VTS *vts) {
3781 void INLINE ClearMemoryStateInOneLine(Thread *thr, uintptr_t addr,
3802 void NOINLINE ClearMemoryState(Thread *thr, uintptr_t a, uintptr_t b) {
3907 // For each thread we store a limited amount of history of locks and unlocks.
4011 // For each thread we store a limited amount of recent segments with
4013 // When a thread enters a new basic block, we can sometimes reuse a
4055 // *) 2 if it is the current segment of the Thread.
4178 // - two of them are in one thread and 3-rd in another thread.
4294 // -------- Thread ------------------ {{{1
4295 struct Thread {
4299 Thread(TID tid, TID parent_tid, VTS *vts, StackTrace *creation_context,
4321 NewSegmentWithoutUnrefingOld("Thread Creation", vts);
4380 Report("INFO: T0 is program's main thread\n");
4386 Thread * parent = GetIfExists(parent_tid_);
4478 Thread* joined_thread = Thread::Get(joined_tid);
4479 // Sometimes the joined thread is not truly dead yet.
4501 static Thread *GetIfExists(TID tid) {
4507 static Thread *Get(TID tid) {
4728 Segment::Ref(new_sid, "Thread::NewSegmentWithoutUnrefingOld");
4742 Segment::Unref(old_sid, "Thread::NewSegment");
4772 GetSomeFreshSids(); // fill the thread-local SID cache.
4789 // This part is 100% thread-local, no need for locking.
4791 Segment::Ref(match, "Thread::HandleSblockEnter");
4792 this->AddDeadSid(sid_, "Thread::HandleSblockEnter");
4802 // We have a fresh ready-to-use segment in thread local cache.
4807 this->AddDeadSid(sid_, "Thread::HandleSblockEnter-1");
4808 Segment::Ref(fresh_sid, "Thread::HandleSblockEnter-1");
4842 // When creating a child thread, we need to know
4843 // 1. where the thread was created (ctx)
4844 // 2. What was the vector clock of the parent thread (vts).
4878 // This event comes when we are exiting the thread creation routine.
4894 Thread *parent = this;
5138 for (int i = 0; i < Thread::NumberOfThreads(); i++) {
5139 Thread *thr = Get(TID(i));
5158 all_threads_ = new Thread*[G_flags->max_n_threads];
5159 memset(all_threads_, 0, sizeof(Thread*) * G_flags->max_n_threads);
5169 // When running fast path w/o a lock we need to recycle SIDs to a thread-local
5174 // a thread-local array.
5228 TID tid_; // This thread's tid.
5282 // All threads. The main thread has tid 0.
5283 static Thread **all_threads_;
5291 INLINE static int32_t raw_tid(Thread *t) {
5295 // Thread:: static members
5296 Thread **Thread::all_threads_;
5297 int Thread::n_threads_;
5298 Thread::SignallerMap *Thread::signaller_map_;
5299 Thread::CyclicBarrierMap *Thread::cyclic_barrier_map_;
5339 static void ForgetAllStateAndStartOver(Thread *thr, const char *reason) {
5354 Report("INFO: Thread Sanitizer will now forget all history.\n");
5368 Thread::ForgetAllState();
5395 static INLINE void FlushStateIfOutOfSegments(Thread *thr) {
5545 bool NOINLINE AddReport(Thread *thr, uintptr_t pc, bool is_w, uintptr_t addr,
5633 Thread::Get(seg->tid())->Announce();
5645 Thread *thr1 = Thread::Get(tid);
5654 Thread *thr2 = Thread::Get(seg->tid());
5722 Thread *thr = Thread::Get(tid);
5858 Report("WARNING: Lock %s was released by thread T%d"
5866 Report("WARNING: Unlocking a non-locked lock %s in thread T%d: "
5874 Report("WARNING: accessing an invalid lock %p in thread T%d: "
5949 for (int i = 0; i < Thread::NumberOfThreads(); i++) {
5950 Thread *t = Thread::Get(TID(i));
5995 for (int i = 0; i < Thread::NumberOfThreads(); i++) {
5996 Thread *t = Thread::Get(TID(i));
6044 void Sample(Thread *thr, const char *event_name, bool need_locking) {
6116 void INLINE HandleTraceLoop(Thread *thr, uintptr_t pc,
6151 void HandleTrace(Thread *thr, MopInfo *mops, size_t n, uintptr_t pc,
6173 void INLINE HandleMemoryAccess(Thread *thr, uintptr_t pc,
6240 void FlushIfOutOfMem(Thread *thr) {
6270 ForgetAllStateAndStartOver(Thread::Get(tid),
6274 void FlushIfNeeded(Thread *thr) {
6316 Thread *thr = Thread::Get(tid);
6327 Thread *thr = NULL;
6329 thr = Thread::Get(TID(e->tid()));
6359 Thread::Get(TID(e->tid()))->stats.events[type]++;
6520 Thread *thread = Thread::Get(TID(e->tid()));
6521 VTS *vts = thread->segment()->vts()->Clone();
6523 thread->NewSegmentForSignal();
6535 Thread *thread = Thread::Get(TID(e->tid()));
6536 thread->NewSegmentForWait(putter);
6556 Thread *thread = Thread::Get(tid);
6557 VTS *vts = thread->segment()->vts();
6558 PublishRange(thread, mem, mem + size, vts);
6560 thread->NewSegmentForSignal();
6568 Thread *thread = Thread::Get(TID(e->tid()));
6569 thread->set_ignore_accesses(is_w, on);
6575 Thread *thr = Thread::Get(tid);
6608 Thread *thread = Thread::Get(tid);
6609 expected_race.pc = thread->GetCallstackEntry(1);
6614 thread->ReportStackTrace(ptr);
6627 Thread *thread = Thread::Get(TID(e->tid()));
6629 thread->ReportStackTrace();
6659 Thread *thread = Thread::Get(TID(e->tid()));
6662 thread->ReportStackTrace();
6668 thread->HandleUnlock(lock_addr);
6676 Thread *thread = Thread::Get(TID(e->tid()));
6701 report->stack_trace = thread->CreateStackTrace();
6707 thread->HandleUnlock(lock_addr);
6710 thread->HandleForgetSignaller(lock_addr);
6718 Thread *thr = Thread::Get(TID(e->tid()));
6798 bool INLINE MemoryStateMachine(ShadowValue old_sval, Thread *thr,
6854 // Fast path implementation for the case when we stay in the same thread.
6860 Thread *thr,
6878 // same thread, but the segments are different.
6919 // same thread, but the segments are different.
6988 Thread *thr,
7068 Thread *thr, uintptr_t addr, MopInfo *mop,
7215 void DoTrace(Thread *thr, uintptr_t addr, MopInfo *mop, bool need_locking) {
7245 void HandleMemoryAccessSlowLocked(Thread *thr,
7279 INLINE bool HandleMemoryAccessInternal(Thread *thr,
7382 void HandleMemoryAccessForAtomicityViolationDetector(Thread *thr,
7431 Thread *thr = Thread::Get(tid);
7455 // Mmap may be used for thread stack, so we should keep the mmap info
7464 void ImitateWriteOnFree(Thread *thr, uintptr_t a, uintptr_t size, uintptr_t pc) {
7483 Thread *thr = Thread::Get(tid);
7539 // main thread, we are done.
7542 Thread::StopIgnoringAccessesInT0BecauseNewThreadStarted();
7543 Report("INFO: creating thread T%d w/o a parent\n", child_tid.raw());
7546 Thread::StopIgnoringAccessesInT0BecauseNewThreadStarted();
7547 Thread *parent = Thread::Get(parent_tid);
7555 Thread *new_thread = new Thread(child_tid, parent_tid,
7557 CHECK(new_thread == Thread::Get(child_tid));
7559 new_thread->set_ignore_all_accesses(true); // until a new thread comes.
7563 // Executes before the first instruction of the thread but after the thread
7570 Thread *thr = Thread::Get(tid);
7579 Thread *thr = Thread::Get(tid);
7610 Thread *thr = Thread::Get(tid);
7611 // Add the thread-local stats to global stats.
7617 Thread *child = Thread::Get(tid);
7655 Thread *parent_thr = Thread::Get(tid);
8043 G_flags->cut_stack_below.push_back("Thread*ThreadBody*");
8082 debug_thread = PhaseDebugIsOn("thread");
8377 Thread::InitClassMembers();
8427 for (int i = 0; i < Thread::NumberOfThreads(); i++) {
8428 Thread *t = Thread::Get(TID(i));
8434 for (int i = 0; i < Thread::NumberOfThreads(); i++) {
8435 Thread *t = Thread::Get(TID(i));
8448 Thread *ThreadSanitizerGetThreadByTid(int32_t tid) {
8449 return Thread::Get(TID(tid));
8454 ThreadSanitizerHandleTrace(Thread::Get(TID(tid)), trace_info, tleb);
8456 extern NOINLINE void ThreadSanitizerHandleTrace(Thread *thr, TraceInfo *trace_info,
8467 extern NOINLINE void ThreadSanitizerHandleOneMemoryAccess(Thread *thr,
8481 // This does locking on a cold path. Hot path in thread-local.
8486 Thread *thr = Thread::Get(TID(tid));
8491 // This is a thread-local operation, no need for locking.
8492 Thread::Get(TID(tid))->HandleRtnExit();