summaryrefslogtreecommitdiff
path: root/lib/libpthread/thread/thr_init.c
diff options
context:
space:
mode:
authorJason Evans <jasone@FreeBSD.org>2000-01-19 07:04:50 +0000
committerJason Evans <jasone@FreeBSD.org>2000-01-19 07:04:50 +0000
commit0a3fa43c7e06dfbd6ddde4767d9c8a0c6a2ad51f (patch)
treed60f837da3362893d30d022990c52c439190405b /lib/libpthread/thread/thr_init.c
parent1c12990b99e0a50adad4fb4691b64378de2f1b12 (diff)
Notes
Diffstat (limited to 'lib/libpthread/thread/thr_init.c')
-rw-r--r--lib/libpthread/thread/thr_init.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/libpthread/thread/thr_init.c b/lib/libpthread/thread/thr_init.c
index b6429bbe43a0..dd5f53fac64e 100644
--- a/lib/libpthread/thread/thr_init.c
+++ b/lib/libpthread/thread/thr_init.c
@@ -184,6 +184,10 @@ _thread_init(void)
/* Initialize the scheduling switch hook routine: */
_sched_switch_hook = NULL;
+ /* Give this thread default attributes: */
+ memcpy((void *) &_thread_initial->attr, &pthread_attr_default,
+ sizeof(struct pthread_attr));
+
/* Initialize the thread stack cache: */
SLIST_INIT(&_stackq);
@@ -199,6 +203,14 @@ _thread_init(void)
-1, 0) == MAP_FAILED)
PANIC("Cannot allocate red zone for initial thread");
+ /* Set the main thread stack pointer. */
+ _thread_initial->stack = (void *) USRSTACK -
+ PTHREAD_STACK_INITIAL;
+
+ /* Set the stack attributes: */
+ _thread_initial->attr.stackaddr_attr = _thread_initial->stack;
+ _thread_initial->attr.stacksize_attr = PTHREAD_STACK_INITIAL;
+
/*
* Write a magic value to the thread structure
* to help identify valid ones: