mirror of https://git.musl-libc.org/git/musl
Browse Source
commitmasterd26e0774a5moved the detach state transition at exit before the thread list lock was taken. this inadvertently allowed pthread_join to race to take the thread list lock first, and proceed with unmapping of the exiting thread's memory. we could fix this by just revering the offending commit and instead performing __vm_wait unconditionally before taking the thread list lock, but that may be costly. instead, bring back the old DT_EXITING vs DT_EXITED state distinction that was removed in commit8f11e6127f, and don't transition to DT_EXITED (a value of 0, which is what pthread_join waits for) until after the lock has been taken.
2 changed files with 3 additions and 1 deletions
Loading…
Reference in new issue