mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-04 00:40:27 +00:00
Fix --strace use-after-free in pthread_join()
This commit is contained in:
parent
d1d4388201
commit
f2c8ddbbe3
2 changed files with 5 additions and 5 deletions
|
@ -22,11 +22,8 @@
|
|||
#include "libc/thread/thread.h"
|
||||
|
||||
int _pthread_tid(struct PosixThread *pt) {
|
||||
if (IsWindows()) // xxx: fixme
|
||||
return pt->ptid;
|
||||
int tid = 0;
|
||||
while (pt && !(tid = atomic_load_explicit(&pt->ptid, memory_order_acquire))) {
|
||||
while (pt && !(tid = atomic_load_explicit(&pt->ptid, memory_order_acquire)))
|
||||
pthread_pause_np();
|
||||
}
|
||||
return tid;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue