mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-24 14:22:28 +00:00
Make some fixups to POSIX threads
This commit is contained in:
parent
de511bc71a
commit
6c323383e5
12 changed files with 168 additions and 69 deletions
|
@ -32,14 +32,15 @@
|
|||
*/
|
||||
int pthread_join(pthread_t thread, void **value_ptr) {
|
||||
struct PosixThread *pt = thread;
|
||||
if (pt->status == kPosixThreadDetached) {
|
||||
if (pt->status == kPosixThreadDetached || //
|
||||
pt->status == kPosixThreadZombie) {
|
||||
assert(!"badjoin");
|
||||
return EDEADLK;
|
||||
}
|
||||
pthread_wait(pt);
|
||||
_pthread_wait(pt);
|
||||
if (value_ptr) {
|
||||
*value_ptr = pt->rc;
|
||||
}
|
||||
pthread_free(pt);
|
||||
_pthread_free(pt);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue