diff options
| author | Daniel Eischen <deischen@FreeBSD.org> | 2004-12-18 18:07:37 +0000 |
|---|---|---|
| committer | Daniel Eischen <deischen@FreeBSD.org> | 2004-12-18 18:07:37 +0000 |
| commit | 843d4004b367db61428fa1cbf611cdbd2791d672 (patch) | |
| tree | 3341fdd3fcdb8d611509d7622be5b25f271de80a /lib/libpthread/thread/thr_once.c | |
| parent | 885dabe5f70ceac846c6d0623c64914d5c401f10 (diff) | |
Notes
Diffstat (limited to 'lib/libpthread/thread/thr_once.c')
| -rw-r--r-- | lib/libpthread/thread/thr_once.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libpthread/thread/thr_once.c b/lib/libpthread/thread/thr_once.c index ad158d13e599..40344bdc28ed 100644 --- a/lib/libpthread/thread/thr_once.c +++ b/lib/libpthread/thread/thr_once.c @@ -67,6 +67,7 @@ once_cancel_handler(void *arg) int _pthread_once(pthread_once_t *once_control, void (*init_routine) (void)) { + struct pthread *curthread; int wakeup = 0; if (once_control->state == ONCE_DONE) @@ -81,9 +82,10 @@ _pthread_once(pthread_once_t *once_control, void (*init_routine) (void)) if (*(volatile int *)&(once_control->state) == ONCE_NEVER_DONE) { once_control->state = ONCE_IN_PROGRESS; _pthread_mutex_unlock(&once_lock); - _pthread_cleanup_push(once_cancel_handler, once_control); + curthread = _get_curthread(); + THR_CLEANUP_PUSH(curthread, once_cancel_handler, once_control); init_routine(); - _pthread_cleanup_pop(0); + THR_CLEANUP_POP(curthread, 0); _pthread_mutex_lock(&once_lock); once_control->state = ONCE_DONE; wakeup = 1; |
