Do more quality assurance work

This commit is contained in:
Justine Tunney 2024-06-24 06:53:49 -07:00
parent 67b19ae733
commit d461c6f47d
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
31 changed files with 194 additions and 108 deletions

View file

@ -32,6 +32,16 @@ struct Dtor {
static _Thread_local struct Dtor *__cxa_thread_atexit_list;
static void _pthread_unwind(struct CosmoTib *tib) {
struct PosixThread *pt;
struct _pthread_cleanup_buffer *cb;
pt = (struct PosixThread *)tib->tib_pthread;
while ((cb = pt->pt_cleanup)) {
pt->pt_cleanup = cb->__prev;
cb->__routine(cb->__arg);
}
}
static void __cxa_thread_unkey(struct CosmoTib *tib) {
void *val;
int i, j, gotsome;
@ -67,16 +77,18 @@ static void _pthread_ungarbage(struct CosmoTib *tib) {
void __cxa_thread_finalize(void) {
struct Dtor *dtor;
struct CosmoTib *tib;
tib = __get_tls();
_pthread_unwind(tib);
if (tib->tib_nsync)
_weaken(nsync_waiter_destroy)(tib->tib_nsync);
__cxa_thread_unkey(tib);
_pthread_ungarbage(tib);
while ((dtor = __cxa_thread_atexit_list)) {
__cxa_thread_atexit_list = dtor->next;
((void (*)(void *))dtor->fun)(dtor->arg);
_weaken(free)(dtor);
}
struct CosmoTib *tib = __get_tls();
__cxa_thread_unkey(tib);
if (tib->tib_nsync)
_weaken(nsync_waiter_destroy)(tib->tib_nsync);
_pthread_ungarbage(tib);
}
int __cxa_thread_atexit_impl(void *fun, void *arg, void *dso_symbol) {