Skip to content

Commit 46e63ea

Browse files
committed
update comment
1 parent 528c47b commit 46e63ea

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,8 +1132,10 @@ TSAN_INTERCEPTOR(int, pthread_join, void *th, void **ret) {
11321132
SCOPED_INTERCEPTOR_RAW(pthread_join, th, ret);
11331133
#if SANITIZER_ANDROID
11341134
{
1135-
// In Bionic, pthread_detach calls pthread_join, so the thread has already
1136-
// been consumed by the pthread_detach interceptor.
1135+
// In Bionic, if the target thread has already exited when pthread_detach is
1136+
// called, pthread_detach will call pthread_join internally to clean it up.
1137+
// In that case, the thread has already been consumed by the pthread_detach
1138+
// interceptor.
11371139
Tid tid = ctx->thread_registry.FindThread(
11381140
[](ThreadContextBase* tctx, void* arg) {
11391141
return tctx->user_id == (uptr)arg;

0 commit comments

Comments
 (0)