summaryrefslogtreecommitdiff
path: root/sysdeps/mach/pt-thread-halt.c
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@schwinge.name>2010-04-12 12:55:15 +0200
committerThomas Schwinge <thomas@schwinge.name>2010-04-12 12:55:40 +0200
commit0d733170f4056ffef9ae7e3c1f0e627b47433a97 (patch)
tree9f2c4e2dd0157e102f8ac6d8b14d3c769ef4f1ba /sysdeps/mach/pt-thread-halt.c
parentfe9047b145260f4a28436f640f4d9df1208c402d (diff)
parent50a5d4825869a40ecddf650181b6c4f75dfc6dd0 (diff)
Merge remote branch 'remotes/savannah/master-fix_have_kernel_resources' into t/fix_have_kernel_resources
Diffstat (limited to 'sysdeps/mach/pt-thread-halt.c')
-rw-r--r--sysdeps/mach/pt-thread-halt.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/sysdeps/mach/pt-thread-halt.c b/sysdeps/mach/pt-thread-halt.c
index 973cde1..a9c3858 100644
--- a/sysdeps/mach/pt-thread-halt.c
+++ b/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);
+ }
+ }
}