Skip to content

Commit

Permalink
Fix assertion error in pthread_create()
Browse files Browse the repository at this point in the history
  • Loading branch information
jart committed Jan 22, 2024
1 parent 51cd83f commit 8ebe2e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libc/thread/pthread_create.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ static errno_t pthread_create_impl(pthread_t *thread,
errno = e;
return EAGAIN;
}
dll_init(&pt->list);
pt->pt_start = start_routine;
pt->pt_arg = arg;

Expand Down Expand Up @@ -289,7 +290,6 @@ static errno_t pthread_create_impl(pthread_t *thread,

// add thread to global list
// we add it to the beginning since zombies go at the end
dll_init(&pt->list);
_pthread_lock();
dll_make_first(&_pthread_list, &pt->list);
_pthread_unlock();
Expand Down

0 comments on commit 8ebe2e9

Please sign in to comment.