summaryrefslogtreecommitdiffstats
path: root/lib/libc_r/uthread/uthread_create.c
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2002-11-13 18:13:26 +0000
committerdeischen <deischen@FreeBSD.org>2002-11-13 18:13:26 +0000
commit524a6c841c467da890061cbdc2ace08d30e6e780 (patch)
tree666eecc4a4a3cc9346ca8828770bb7ef3723e4b2 /lib/libc_r/uthread/uthread_create.c
parentbf8788517dc3dbb62a46b61b9a2e31a4ba2d3dd4 (diff)
downloadFreeBSD-src-524a6c841c467da890061cbdc2ace08d30e6e780.zip
FreeBSD-src-524a6c841c467da890061cbdc2ace08d30e6e780.tar.gz
At initialization, override the pthread stub routines in libc
by filling in the jump table. Convert uses of pthread routines within libc_r to use the internal versions (_pthread_foo instead of pthread_foo). Remove a couple of globals from application namespace.
Diffstat (limited to 'lib/libc_r/uthread/uthread_create.c')
-rw-r--r--lib/libc_r/uthread/uthread_create.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/libc_r/uthread/uthread_create.c b/lib/libc_r/uthread/uthread_create.c
index 6769428..d101721 100644
--- a/lib/libc_r/uthread/uthread_create.c
+++ b/lib/libc_r/uthread/uthread_create.c
@@ -39,7 +39,10 @@
#include <stddef.h>
#include <sys/time.h>
#include <machine/reg.h>
+#include "namespace.h"
#include <pthread.h>
+#include "un-namespace.h"
+
#include "pthread_private.h"
#include "libc_private.h"
@@ -88,7 +91,7 @@ _pthread_create(pthread_t *thread, const pthread_attr_t *attr,
/* Check if default thread attributes are required: */
if (attr == NULL || *attr == NULL) {
/* Use the default thread attributes: */
- pattr = &pthread_attr_default;
+ pattr = &_pthread_attr_default;
} else {
pattr = *attr;
}
@@ -244,8 +247,8 @@ _pthread_create(pthread_t *thread, const pthread_attr_t *attr,
* Start a garbage collector thread
* if necessary.
*/
- if (f_gc && pthread_create(&gc_thread,NULL,
- _thread_gc,NULL) != 0)
+ if (f_gc && _pthread_create(&gc_thread, NULL,
+ _thread_gc, NULL) != 0)
PANIC("Can't create gc thread");
}
@@ -264,7 +267,7 @@ _thread_start(void)
_thread_kern_in_sched = 0;
/* Run the current thread's start routine with argument: */
- pthread_exit(curthread->start_routine(curthread->arg));
+ _pthread_exit(curthread->start_routine(curthread->arg));
/* This point should never be reached. */
PANIC("Thread has resumed after exit");
OpenPOWER on IntegriCloud