From 43b5f378b58e4585b4244920dc66caa1915b4eb0 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 18 Apr 2009 15:41:25 +0000 Subject: * debian/patches/libports_stability.patch: New patch to keep the old behavior of libports. * debian/patches/libpthread_fix.patch New patch from Thomas Schwinge to fix libpthread. --- debian/patches/libports_stability.patch | 14 +++++++++++ debian/patches/libpthread_fix.patch | 43 +++++++++++++++++++++++++++++++++ debian/patches/series | 2 ++ 3 files changed, 59 insertions(+) create mode 100644 debian/patches/libports_stability.patch create mode 100644 debian/patches/libpthread_fix.patch (limited to 'debian/patches') diff --git a/debian/patches/libports_stability.patch b/debian/patches/libports_stability.patch new file mode 100644 index 00000000..462fc1ca --- /dev/null +++ b/debian/patches/libports_stability.patch @@ -0,0 +1,14 @@ +Ideally we should be able to time out and see translators go away automatically, +however it makes all threads often wake at the same time and overload Mach. + +--- libports/manage-multithread.c 29 Dec 2008 18:38:02 -0000 1.20 ++++ libports/manage-multithread.c 20 Aug 1997 20:41:57 -0000 1.19 +@@ -157,6 +157,8 @@ + return 0; + } + ++ thread_timeout = global_timeout = 0; /* XXX */ ++ + nreqthreads = 1; + totalthreads = 1; + thread_function (1); diff --git a/debian/patches/libpthread_fix.patch b/debian/patches/libpthread_fix.patch new file mode 100644 index 00000000..3b13d698 --- /dev/null +++ b/debian/patches/libpthread_fix.patch @@ -0,0 +1,43 @@ +Temporary patch from Thomas Schwinge to fix libpthread bugs. + +diff --git libpthread/sysdeps/mach/pt-thread-dealloc.c b/sysdeps/mach/pt-thread-dealloc.c +index 55d8c4d..0c4a4fc 100644 +--- libpthread/sysdeps/mach/pt-thread-dealloc.c ++++ libpthread/sysdeps/mach/pt-thread-dealloc.c +@@ -38,4 +38,6 @@ __pthread_thread_dealloc (struct __pthread *thread) + assert. */ + __mach_port_destroy (__mach_task_self (), + thread->wakeupmsg.msgh_remote_port); ++ ++ thread->have_kernel_resources = 0; + } +diff --git libpthread/sysdeps/mach/pt-thread-halt.c b/sysdeps/mach/pt-thread-halt.c +index 973cde1..a9c3858 100644 +--- libpthread/sysdeps/mach/pt-thread-halt.c ++++ libpthread/sysdeps/mach/pt-thread-halt.c +@@ -32,6 +32,21 @@ + void + __pthread_thread_halt (struct __pthread *thread) + { +- error_t err = __thread_terminate (thread->kernel_thread); +- assert_perror (err); ++ if (thread->have_kernel_resources) ++ { ++ if (thread == _pthread_self ()) ++ { ++ while (1) ++ { ++ error_t err = __thread_suspend (thread->kernel_thread); ++ assert_perror (err); ++ assert (! "Failed to suspend self."); ++ } ++ } ++ else ++ { ++ error_t err = __thread_terminate (thread->kernel_thread); ++ assert_perror (err); ++ } ++ } + } + + diff --git a/debian/patches/series b/debian/patches/series index fae76eac..e6ced675 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -24,3 +24,5 @@ stat-fix.patch -p0 in6_addr.patch -p1 stat_round.patch -p0 dir_acces_fix.patch -p0 +libports_stability.patch -p0 +libpthread_fix.patch -p0 -- cgit v1.2.3