diff options
author | Ulrich Drepper <drepper@redhat.com> | 2000-01-05 02:09:12 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2000-01-05 02:09:12 +0000 |
commit | 1d2fc9b3c59d0e83e04139ddf633731264b76ea2 (patch) | |
tree | c738cf2a40851dc25be2c252ba5dbb7f335b5e14 /linuxthreads/queue.h | |
parent | f19f2b34439145daf300bf12789bbc61c8d4db28 (diff) | |
download | glibc-1d2fc9b3c59d0e83e04139ddf633731264b76ea2.tar glibc-1d2fc9b3c59d0e83e04139ddf633731264b76ea2.tar.gz glibc-1d2fc9b3c59d0e83e04139ddf633731264b76ea2.tar.bz2 glibc-1d2fc9b3c59d0e83e04139ddf633731264b76ea2.zip |
Redesigned how cancellation unblocks a thread from internal cancellation points (sem_wait, pthread_join, pthread_cond_{wait,timedwait}). Cancellation won't eat a signal in any of these functions (*required* by POSIX and Single Unix Spec!).
2000-01-03 Kaz Kylheku <kaz@ashi.footprints.net>
Redesigned how cancellation unblocks a thread from internal
cancellation points (sem_wait, pthread_join,
pthread_cond_{wait,timedwait}).
Cancellation won't eat a signal in any of these functions
(*required* by POSIX and Single Unix Spec!).
* condvar.c: spontaneous wakeup on pthread_cond_timedwait won't eat a
simultaneous condition variable signal (not required by POSIX
or Single Unix Spec, but nice).
* spinlock.c: __pthread_lock queues back any received restarts
that don't belong to it instead of assuming ownership of lock
upon any restart; fastlock can no longer be acquired by two threads
simultaneously.
* restart.h: restarts queue even on kernels that don't have
queued real time signals (2.0, early 2.1), thanks to atomic counter,
avoiding a rare race condition in pthread_cond_timedwait.
Diffstat (limited to 'linuxthreads/queue.h')
-rw-r--r-- | linuxthreads/queue.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/linuxthreads/queue.h b/linuxthreads/queue.h index fa8c5d861d..f87322f84a 100644 --- a/linuxthreads/queue.h +++ b/linuxthreads/queue.h @@ -43,13 +43,14 @@ static inline pthread_descr dequeue(pthread_descr * q) return th; } -static inline void remove_from_queue(pthread_descr * q, pthread_descr th) +static inline int remove_from_queue(pthread_descr * q, pthread_descr th) { for (; *q != NULL; q = &((*q)->p_nextwaiting)) { if (*q == th) { *q = th->p_nextwaiting; th->p_nextwaiting = NULL; - return; + return 1; } } + return 0; } |