summaryrefslogtreecommitdiff
path: root/debian/patches
diff options
context:
space:
mode:
authorMichael Banck <mbanck@debian.org>2008-10-01 12:33:33 +0000
committerMichael Banck <mbanck@debian.org>2008-10-01 12:33:33 +0000
commitb0a87a102ba57645bf5e8536bbf06988e204ed7f (patch)
tree64d6818f34fe532b0e37391da3b94b62734b0c19 /debian/patches
parent2885b55beaaa2494ac31efaeef16de3b82f32ffe (diff)
* debian/patches/libpthread_mutex_owner.patch: New patch, fix a hang in
libpthread, by Neal Walfield.
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/libpthread_mutex_owner.patch135
-rw-r--r--debian/patches/series1
2 files changed, 136 insertions, 0 deletions
diff --git a/debian/patches/libpthread_mutex_owner.patch b/debian/patches/libpthread_mutex_owner.patch
new file mode 100644
index 00000000..b2b3c7ee
--- /dev/null
+++ b/debian/patches/libpthread_mutex_owner.patch
@@ -0,0 +1,135 @@
+Index: libpthread/sysdeps/generic/pt-mutex-timedlock.c
+===================================================================
+RCS file: /sources/hurd/hurd-l4/libpthread/sysdeps/generic/pt-mutex-timedlock.c,v
+retrieving revision 1.4
+diff -u -p -r1.4 pt-mutex-timedlock.c
+--- libpthread/sysdeps/generic/pt-mutex-timedlock.c 22 Jun 2008 08:58:20 -0000 1.4
++++ libpthread/sysdeps/generic/pt-mutex-timedlock.c 1 Oct 2008 10:37:20 -0000
+@@ -36,6 +36,7 @@ __pthread_mutex_timedlock_internal (stru
+ if (__pthread_spin_trylock (&mutex->__held) == 0)
+ /* Successfully acquired the lock. */
+ {
++#ifdef ALWAYS_TRACK_OWNER
+ #ifndef NDEBUG
+ self = _pthread_self ();
+ if (self)
+@@ -47,6 +48,7 @@ __pthread_mutex_timedlock_internal (stru
+ mutex->owner = _pthread_self ();
+ }
+ #endif
++#endif
+
+ if (mutex->attr)
+ switch (mutex->attr->mutex_type)
+@@ -73,14 +75,16 @@ __pthread_mutex_timedlock_internal (stru
+ self = _pthread_self ();
+ assert (self);
+
+- if (mutex->attr)
++ if (! mutex->attr || mutex->attr->mutex_type == PTHREAD_MUTEX_NORMAL)
++ {
++#if defined(ALWAYS_TRACK_MUTEX_OWNER)
++ assert (mutex->owner != self);
++#endif
++ }
++ else
+ {
+ switch (mutex->attr->mutex_type)
+ {
+- case PTHREAD_MUTEX_NORMAL:
+- assert (mutex->owner != self);
+- break;
+-
+ case PTHREAD_MUTEX_ERRORCHECK:
+ if (mutex->owner == self)
+ {
+@@ -102,10 +106,11 @@ __pthread_mutex_timedlock_internal (stru
+ LOSE;
+ }
+ }
+- else
+- assert (mutex->owner != self);
+
+- assert (mutex->owner);
++#if !defined(ALWAYS_TRACK_MUTEX_OWNER)
++ if (mutex->attr && mutex->attr->mutex_type != PTHREAD_MUTEX_NORMAL)
++#endif
++ assert (mutex->owner);
+
+ if (abstime && (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000))
+ return EINVAL;
+@@ -141,9 +146,12 @@ __pthread_mutex_timedlock_internal (stru
+ else
+ __pthread_block (self);
+
+-#ifndef NDEBUG
+- assert (mutex->owner == self);
++#if !defined(ALWAYS_TRACK_MUTEX_OWNER)
++ if (mutex->attr && mutex->attr->mutex_type != PTHREAD_MUTEX_NORMAL)
+ #endif
++ {
++ assert (mutex->owner == self);
++ }
+
+ if (mutex->attr)
+ switch (mutex->attr->mutex_type)
+Index: libpthread/sysdeps/generic/pt-mutex-transfer-np.c
+===================================================================
+RCS file: /sources/hurd/hurd-l4/libpthread/sysdeps/generic/pt-mutex-transfer-np.c,v
+retrieving revision 1.1
+diff -u -p -r1.1 pt-mutex-transfer-np.c
+--- libpthread/sysdeps/generic/pt-mutex-transfer-np.c 1 Mar 2008 13:07:22 -0000 1.1
++++ libpthread/sysdeps/generic/pt-mutex-transfer-np.c 1 Oct 2008 10:37:20 -0000
+@@ -45,7 +45,12 @@ __pthread_mutex_transfer_np (struct __pt
+ }
+
+ #ifndef NDEBUG
+- mutex->owner = thread;
++# if !defined(ALWAYS_TRACK_MUTEX_OWNER)
++ if (mutex->attr && mutex->attr->mutex_type != PTHREAD_MUTEX_NORMAL)
++# endif
++ {
++ mutex->owner = thread;
++ }
+ #endif
+
+ return 0;
+Index: libpthread/sysdeps/generic/pt-mutex-unlock.c
+===================================================================
+RCS file: /sources/hurd/hurd-l4/libpthread/sysdeps/generic/pt-mutex-unlock.c,v
+retrieving revision 1.5
+diff -u -p -r1.5 pt-mutex-unlock.c
+--- libpthread/sysdeps/generic/pt-mutex-unlock.c 22 Jun 2008 09:16:45 -0000 1.5
++++ libpthread/sysdeps/generic/pt-mutex-unlock.c 1 Oct 2008 10:37:20 -0000
+@@ -33,7 +33,8 @@ __pthread_mutex_unlock (pthread_mutex_t
+
+ if (! mutex->attr || mutex->attr->mutex_type == PTHREAD_MUTEX_NORMAL)
+ {
+-#ifndef NDEBUG
++#if defined(ALWAYS_TRACK_MUTEX_OWNER)
++# ifndef NDEBUG
+ if (_pthread_self ())
+ {
+ assert (mutex->owner);
+@@ -45,6 +46,7 @@ __pthread_mutex_unlock (pthread_mutex_t
+ _pthread_self ()->threadid);
+ mutex->owner = NULL;
+ }
++# endif
+ #endif
+ }
+ else
+@@ -84,7 +86,12 @@ __pthread_mutex_unlock (pthread_mutex_t
+ __pthread_dequeue (wakeup);
+
+ #ifndef NDEBUG
+- mutex->owner = wakeup;
++# if !defined (ALWAYS_TRACK_MUTEX_OWNER)
++ if (mutex->attr && mutex->attr->mutex_type != PTHREAD_MUTEX_NORMAL)
++# endif
++ {
++ mutex->owner = wakeup;
++ }
+ #endif
+
+ /* We do not unlock MUTEX->held: we are transferring the ownership
diff --git a/debian/patches/series b/debian/patches/series
index 0c41d394..edaf30fa 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,6 +5,7 @@ hurd_console_startup.patch -p0
init_try_runsystem.gnu.patch -p0
install-msgids.diff -p2
libpager_update_seqno.patch -p0
+libpthread_mutex_owner.patch -p0
libpthread_stubs.patch -p0
libpthread_tls.patch -p0
makedev.diff -p0