Skip to content

Commit 0ba678a

Browse files
authored
[tsan] Set thr->is_inited after SlotAttachAndLock (#86342)
Almost NFC. This is symmetrical to `ThreadFinish`, which resets the slot after `is_inited`.
1 parent 913e299 commit 0ba678a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ void ThreadStart(ThreadState *thr, Tid tid, tid_t os_id,
160160
}
161161
Free(thr->tctx->sync);
162162

163+
#if !SANITIZER_GO
164+
thr->is_inited = true;
165+
#endif
166+
163167
uptr stk_addr = 0;
164168
uptr stk_size = 0;
165169
uptr tls_addr = 0;
@@ -205,9 +209,6 @@ void ThreadContext::OnStarted(void *arg) {
205209
if (common_flags()->detect_deadlocks)
206210
thr->dd_lt = ctx->dd->CreateLogicalThread(tid);
207211
thr->tctx = this;
208-
#if !SANITIZER_GO
209-
thr->is_inited = true;
210-
#endif
211212
}
212213

213214
void ThreadFinish(ThreadState *thr) {

0 commit comments

Comments
 (0)