Perform some code cleanup

This commit is contained in:
Justine Tunney 2022-06-23 10:21:07 -07:00
parent 0dd9629562
commit a4601a24d3
63 changed files with 350 additions and 1643 deletions

View file

@ -29,6 +29,7 @@
#include "libc/sysv/consts/clone.h"
#include "libc/sysv/consts/map.h"
#include "libc/sysv/consts/prot.h"
#include "libc/thread/internal.h"
#include "libc/thread/thread.h"
STATIC_YOINK("_main_thread_ctor");
@ -77,6 +78,7 @@ static int cthread_start(void *arg) {
exitcode = (void *)rc.dx;
}
td->exitcode = exitcode;
_pthread_key_destruct(td->key);
if (atomic_load(&td->state) & cthread_detached) {
// we're still using the stack
// thus we can't munmap it yet