summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/mach/hurd/pt-sysdep.h5
-rw-r--r--sysdeps/mach/pt-thread-alloc.c5
-rw-r--r--sysdeps/mach/pt-thread-halt.c10
3 files changed, 10 insertions, 10 deletions
diff --git a/sysdeps/mach/hurd/pt-sysdep.h b/sysdeps/mach/hurd/pt-sysdep.h
index 83bad963..f14a1366 100644
--- a/sysdeps/mach/hurd/pt-sysdep.h
+++ b/sysdeps/mach/hurd/pt-sysdep.h
@@ -1,5 +1,5 @@
/* Internal defenitions for pthreads library.
- Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2002, 2008 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -32,7 +32,8 @@
#define PTHREAD_SYSDEP_MEMBERS \
thread_t kernel_thread; \
- mach_msg_header_t wakeupmsg;
+ mach_msg_header_t wakeupmsg; \
+ int have_kernel_resources;
#define _HURD_THREADVAR_THREAD _HURD_THREADVAR_DYNAMIC_USER
diff --git a/sysdeps/mach/pt-thread-alloc.c b/sysdeps/mach/pt-thread-alloc.c
index 1acba98a..7706a2bd 100644
--- a/sysdeps/mach/pt-thread-alloc.c
+++ b/sysdeps/mach/pt-thread-alloc.c
@@ -63,6 +63,9 @@ create_wakeupmsg (struct __pthread *thread)
int
__pthread_thread_alloc (struct __pthread *thread)
{
+ if (thread->have_kernel_resources)
+ return 0;
+
error_t err;
err = create_wakeupmsg (thread);
@@ -97,5 +100,7 @@ __pthread_thread_alloc (struct __pthread *thread)
return EAGAIN;
}
+ thread->have_kernel_resources = true;
+
return 0;
}
diff --git a/sysdeps/mach/pt-thread-halt.c b/sysdeps/mach/pt-thread-halt.c
index 9f860247..973cde1e 100644
--- a/sysdeps/mach/pt-thread-halt.c
+++ b/sysdeps/mach/pt-thread-halt.c
@@ -30,14 +30,8 @@
being halted, thus the last action should be halting the thread
itself. */
void
-__pthread_thread_halt (struct __pthread *thread, int need_dealloc)
+__pthread_thread_halt (struct __pthread *thread)
{
- error_t err;
- thread_t tid = thread->kernel_thread;
-
- if (need_dealloc)
- __pthread_dealloc (thread);
-
- err = __thread_terminate (tid);
+ error_t err = __thread_terminate (thread->kernel_thread);
assert_perror (err);
}