aboutsummaryrefslogtreecommitdiff
path: root/linuxthreads
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-03-15 07:50:48 +0000
committerUlrich Drepper <drepper@redhat.com>2000-03-15 07:50:48 +0000
commit5d1415976fb392aac199c42a47bf453a86286da5 (patch)
tree1a962b9171aed5571400290ab7a4c7ae4d455634 /linuxthreads
parent30b416ea87471a739763966fddc37f6273be58e0 (diff)
downloadglibc-5d1415976fb392aac199c42a47bf453a86286da5.tar
glibc-5d1415976fb392aac199c42a47bf453a86286da5.tar.gz
glibc-5d1415976fb392aac199c42a47bf453a86286da5.tar.bz2
glibc-5d1415976fb392aac199c42a47bf453a86286da5.zip
Update.
2000-03-08 Andreas Jaeger <aj@suse.de> * sysdeps/unix/sysv/linux/scsi/sg.h: Sync with Linux 2.3.50. * timezone/africa: Update from tzdata2000d. * timezone/asia: Likewise. * timezone/australasia: Likewise. * timezone/europe: Likewise. * timezone/northamerica: Likewise. * timezone/southamerica: Likewise. * po/fr.po: Update from translation team. * po/de.po: Likewise. * sysdeps/i386/fpu/bits/mathinline.h: Fix union definition error in __sgn1l, otherwise g++ fails to parse this. Reported by Sean Chen <sean.chen@turbolinux.com>.
Diffstat (limited to 'linuxthreads')
-rw-r--r--linuxthreads/ChangeLog4
-rw-r--r--linuxthreads/condvar.c8
2 files changed, 12 insertions, 0 deletions
diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog
index 2a7bcb9e60..725653b02c 100644
--- a/linuxthreads/ChangeLog
+++ b/linuxthreads/ChangeLog
@@ -1,5 +1,9 @@
2000-03-14 Ulrich Drepper <drepper@redhat.com>
+ * condvar.c (pthread_cond_wait): Check whether mutex is owned by
+ current thread and return error if not.
+ (pthread_cond_timedwait): Likewise.
+
* mutex.c (__pthread_once): Handle cancelled init function correctly.
(pthread_once_cancelhandler): New function.
Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
diff --git a/linuxthreads/condvar.c b/linuxthreads/condvar.c
index 410ca65af0..d1e91d228c 100644
--- a/linuxthreads/condvar.c
+++ b/linuxthreads/condvar.c
@@ -77,6 +77,10 @@ int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
pthread_extricate_if extr;
int already_canceled = 0;
+ /* Check whether the mutex is locked and owned by this thread. */
+ if (mutex->__m_owner != self)
+ return EINVAL;
+
/* Set up extrication interface */
extr.pu_object = cond;
extr.pu_extricate_func = cond_extricate_func;
@@ -380,6 +384,10 @@ pthread_cond_timedwait_relative_new(pthread_cond_t *cond,
int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
const struct timespec * abstime)
{
+ /* Check whether the mutex is locked and owned by this thread. */
+ if (mutex->__m_owner != self)
+ return EINVAL;
+
/* Indirect call through pointer! */
return pthread_cond_tw_rel(cond, mutex, abstime);
}