diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2001-12-08 14:51:37 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2001-12-08 14:51:37 +0000 |
commit | f12d711b8ff30cbb7e08bb32d88af46cc64c0769 (patch) | |
tree | 5fd6e5a28182f82c323032d9dce6aa32a60b622b /lib/libc_r/uthread/uthread_cond.c | |
parent | 203c9a03b47df77947e1b30e3a939aa45a9a35e0 (diff) |
Partially sync with FreeBSD; mostly pthread_cancel(3) related changes.
make includes is needed in case you want to play.
Diffstat (limited to 'lib/libc_r/uthread/uthread_cond.c')
-rw-r--r-- | lib/libc_r/uthread/uthread_cond.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/libc_r/uthread/uthread_cond.c b/lib/libc_r/uthread/uthread_cond.c index 48ee72a6b2f..dea5d5ffa39 100644 --- a/lib/libc_r/uthread/uthread_cond.c +++ b/lib/libc_r/uthread/uthread_cond.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uthread_cond.c,v 1.10 2001/08/21 19:24:53 fgsch Exp $ */ +/* $OpenBSD: uthread_cond.c,v 1.11 2001/12/08 14:51:36 fgsch Exp $ */ /* * Copyright (c) 1995 John Birrell <jb@cimlogic.com.au>. * All rights reserved. @@ -159,7 +159,8 @@ int pthread_cond_wait(pthread_cond_t * cond, pthread_mutex_t * mutex) { struct pthread *curthread = _get_curthread(); - int rval = 0; + int rval = 0; + int interrupted = 0; /* This is a cancellation point: */ _thread_enter_cancellation_point(); @@ -252,6 +253,9 @@ pthread_cond_wait(pthread_cond_t * cond, pthread_mutex_t * mutex) rval = EINVAL; break; } + + if ((interrupted != 0) && (curthread->continuation != NULL)) + curthread->continuation((void *) curthread); } /* No longer in a cancellation point: */ @@ -266,7 +270,8 @@ pthread_cond_timedwait(pthread_cond_t * cond, pthread_mutex_t * mutex, const struct timespec * abstime) { struct pthread *curthread = _get_curthread(); - int rval = 0; + int rval = 0; + int interrupted = 0; /* This is a cancellation point: */ _thread_enter_cancellation_point(); @@ -396,6 +401,8 @@ pthread_cond_timedwait(pthread_cond_t * cond, pthread_mutex_t * mutex, break; } + if ((interrupted != 0) && (curthread->continuation != NULL)) + curthread->continuation((void *) curthread); } /* No longer in a cancellation point: */ |