summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread/thr_init.c
diff options
context:
space:
mode:
authorjasone <jasone@FreeBSD.org>2001-07-20 04:23:11 +0000
committerjasone <jasone@FreeBSD.org>2001-07-20 04:23:11 +0000
commita9a7a5e9d63f8a71f1d3dfe0e1ed1a28ab589215 (patch)
tree656e85a738aa3a12d8926a342cea87c2eae35e1d /lib/libpthread/thread/thr_init.c
parentf7019990adf13ef4a3ccbd680c5c5ba8292d5f7f (diff)
downloadFreeBSD-src-a9a7a5e9d63f8a71f1d3dfe0e1ed1a28ab589215.zip
FreeBSD-src-a9a7a5e9d63f8a71f1d3dfe0e1ed1a28ab589215.tar.gz
Implement pthread_attr_[gs]etguardsize(). Non-default-size stacks used to
be malloc()ed, but they are now allocated using mmap(), just as the default-size stacks are. A separate cache of stacks is kept for non-default-size stacks. Collaboration with: deischen
Diffstat (limited to 'lib/libpthread/thread/thr_init.c')
-rw-r--r--lib/libpthread/thread/thr_init.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/libpthread/thread/thr_init.c b/lib/libpthread/thread/thr_init.c
index b63a111..9f10f74 100644
--- a/lib/libpthread/thread/thr_init.c
+++ b/lib/libpthread/thread/thr_init.c
@@ -268,9 +268,6 @@ _thread_init(void)
memcpy((void *) &_thread_initial->attr, &pthread_attr_default,
sizeof(struct pthread_attr));
- /* Initialize the thread stack cache: */
- SLIST_INIT(&_stackq);
-
/*
* Create a red zone below the main stack. All other stacks are
* constrained to a maximum size by the paramters passed to
@@ -279,7 +276,7 @@ _thread_init(void)
* thread stack that is just beyond.
*/
if (mmap((void *) USRSTACK - PTHREAD_STACK_INITIAL -
- PTHREAD_STACK_GUARD, PTHREAD_STACK_GUARD, 0, MAP_ANON,
+ PTHREAD_GUARD_DEFAULT, PTHREAD_GUARD_DEFAULT, 0, MAP_ANON,
-1, 0) == MAP_FAILED)
PANIC("Cannot allocate red zone for initial thread");
OpenPOWER on IntegriCloud