summaryrefslogtreecommitdiff
path: root/lib/libthr/thread/thr_create.c
diff options
context:
space:
mode:
authorJake Burkholder <jake@FreeBSD.org>2003-04-03 03:34:50 +0000
committerJake Burkholder <jake@FreeBSD.org>2003-04-03 03:34:50 +0000
commit55ad402a8f53bd62c8b85106cf307298f0c952d9 (patch)
treed95f2bb910f0eebc71243aa5c4f13994c66da5ec /lib/libthr/thread/thr_create.c
parenta8949de20eec94dce0e9bc107a5270dd3a8d03b4 (diff)
Notes
Diffstat (limited to 'lib/libthr/thread/thr_create.c')
-rw-r--r--lib/libthr/thread/thr_create.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libthr/thread/thr_create.c b/lib/libthr/thread/thr_create.c
index 539a7c53ff96..3ad7dc0cdff3 100644
--- a/lib/libthr/thread/thr_create.c
+++ b/lib/libthr/thread/thr_create.c
@@ -116,7 +116,8 @@ _pthread_create(pthread_t * thread, const pthread_attr_t * attr,
getcontext(&new_thread->ctx);
new_thread->ctx.uc_stack.ss_sp = new_thread->stack;
new_thread->ctx.uc_stack.ss_size = pattr->stacksize_attr;
- makecontext(&new_thread->ctx, _thread_start, 1, new_thread);
+ makecontext(&new_thread->ctx, _thread_start, 0);
+ new_thread->arch_id = _set_curthread(&new_thread->ctx, new_thread);
/* Copy the thread attributes: */
memcpy(&new_thread->attr, pattr, sizeof(struct pthread_attr));
@@ -208,12 +209,11 @@ _pthread_create(pthread_t * thread, const pthread_attr_t * attr,
}
void
-_thread_start(pthread_t thread)
+_thread_start(void)
{
- thread->arch_id = _set_curthread(thread);
/* Run the current thread's start routine with argument: */
- pthread_exit(thread->start_routine(thread->arg));
+ pthread_exit(curthread->start_routine(curthread->arg));
/* This point should never be reached. */
PANIC("Thread has resumed after exit");