diff options
| author | 2005-12-14 04:01:44 +0000 | |
|---|---|---|
| committer | 2005-12-14 04:01:44 +0000 | |
| commit | 4524a5934ce9eda10e58c7d996c22c47cd5b20aa (patch) | |
| tree | 87bca3f249559beb80dc7064ab2062ff08791f93 /lib/librthread/rthread.c | |
| parent | Adjust debug printing levels to something more sane. (diff) | |
| download | wireguard-openbsd-4524a5934ce9eda10e58c7d996c22c47cd5b20aa.tar.xz wireguard-openbsd-4524a5934ce9eda10e58c7d996c22c47cd5b20aa.zip | |
change keys to use table instead of list, makes a sane destructor implementation
possible
Diffstat (limited to 'lib/librthread/rthread.c')
| -rw-r--r-- | lib/librthread/rthread.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/librthread/rthread.c b/lib/librthread/rthread.c index e60ef5f51a1..db6a492b2be 100644 --- a/lib/librthread/rthread.c +++ b/lib/librthread/rthread.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rthread.c,v 1.3 2005/12/13 05:56:55 tedu Exp $ */ +/* $OpenBSD: rthread.c,v 1.4 2005/12/14 04:01:44 tedu Exp $ */ /* * Copyright (c) 2004 Ted Unangst <tedu@openbsd.org> * All Rights Reserved. @@ -96,6 +96,8 @@ thread_init(void) pthread_t thread; extern int __isthreaded; + printf("rthread init\n"); + __isthreaded = 1; thread = malloc(sizeof(*thread)); @@ -117,7 +119,6 @@ alloc_stack(size_t len) return (stack); } - /* * real pthread functions */ @@ -143,7 +144,9 @@ pthread_exit(void *retval) thread->retval = retval; thread->flags |= THREAD_DONE; + _sem_post(&thread->donesem); + rthread_tls_destructors(thread); #if 0 if (thread->flags & THREAD_DETACHED) free(thread); |
