summaryrefslogtreecommitdiff
path: root/libpthread/sysdeps/l4/hurd/pt-thread-alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libpthread/sysdeps/l4/hurd/pt-thread-alloc.c')
-rw-r--r--libpthread/sysdeps/l4/hurd/pt-thread-alloc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libpthread/sysdeps/l4/hurd/pt-thread-alloc.c b/libpthread/sysdeps/l4/hurd/pt-thread-alloc.c
index ada7b3b..11af1d0 100644
--- a/libpthread/sysdeps/l4/hurd/pt-thread-alloc.c
+++ b/libpthread/sysdeps/l4/hurd/pt-thread-alloc.c
@@ -35,12 +35,15 @@ extern addr_t meta_data_activity;
int
__pthread_thread_alloc (struct __pthread *thread)
{
+ if (thread->have_kernel_resources)
+ return 0;
+
+
/* The main thread is already running of course. */
if (__pthread_num_threads == 1)
{
thread->object = __hurd_startup_data->thread;
thread->threadid = l4_myself ();
- return 0;
}
else
{
@@ -91,5 +94,7 @@ __pthread_thread_alloc (struct __pthread *thread)
thread->object = storage.addr;
}
+ thread->have_kernel_resources = true;
+
return 0;
}