summaryrefslogtreecommitdiffstats
path: root/lib/libc_r/uthread/uthread_stack.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_stack.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_stack.c')
-rw-r--r--lib/libc_r/uthread/uthread_stack.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/libc_r/uthread/uthread_stack.c b/lib/libc_r/uthread/uthread_stack.c
index 80c9d53..63fa4cd 100644
--- a/lib/libc_r/uthread/uthread_stack.c
+++ b/lib/libc_r/uthread/uthread_stack.c
@@ -26,6 +26,7 @@
*
* $FreeBSD$
*/
+#include "namespace.h"
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/param.h>
@@ -33,6 +34,8 @@
#include <sys/user.h>
#include <stdlib.h>
#include <pthread.h>
+#include "un-namespace.h"
+
#include "pthread_private.h"
/* Spare thread stack. */
@@ -144,7 +147,7 @@ _thread_stack_alloc(size_t stacksize, size_t guardsize)
* Use the garbage collector mutex for synchronization of the
* spare stack list.
*/
- if (pthread_mutex_lock(&_gc_mutex) != 0)
+ if (_pthread_mutex_lock(&_gc_mutex) != 0)
PANIC("Cannot lock gc mutex");
if ((spare_stack = LIST_FIRST(&_dstackq)) != NULL) {
@@ -154,7 +157,7 @@ _thread_stack_alloc(size_t stacksize, size_t guardsize)
}
/* Unlock the garbage collector mutex. */
- if (pthread_mutex_unlock(&_gc_mutex) != 0)
+ if (_pthread_mutex_unlock(&_gc_mutex) != 0)
PANIC("Cannot unlock gc mutex");
}
/*
@@ -167,7 +170,7 @@ _thread_stack_alloc(size_t stacksize, size_t guardsize)
* Use the garbage collector mutex for synchronization of the
* spare stack list.
*/
- if (pthread_mutex_lock(&_gc_mutex) != 0)
+ if (_pthread_mutex_lock(&_gc_mutex) != 0)
PANIC("Cannot lock gc mutex");
LIST_FOREACH(spare_stack, &_mstackq, qe) {
@@ -180,7 +183,7 @@ _thread_stack_alloc(size_t stacksize, size_t guardsize)
}
/* Unlock the garbage collector mutex. */
- if (pthread_mutex_unlock(&_gc_mutex) != 0)
+ if (_pthread_mutex_unlock(&_gc_mutex) != 0)
PANIC("Cannot unlock gc mutex");
}
OpenPOWER on IntegriCloud