From 7f15916fab750c09e9fb0e60dc5cf68ba68837e8 Mon Sep 17 00:00:00 2001 From: David Leonard Date: Fri, 26 Nov 1999 00:53:22 +0000 Subject: don't use stack cache if user supplied the storage --- lib/libc_r/uthread/uthread_stack.c | 5 +++-- lib/libpthread/uthread/uthread_stack.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/libc_r/uthread/uthread_stack.c b/lib/libc_r/uthread/uthread_stack.c index 43cbf7cc519..4cc69718111 100644 --- a/lib/libc_r/uthread/uthread_stack.c +++ b/lib/libc_r/uthread/uthread_stack.c @@ -1,4 +1,5 @@ -/* $OpenBSD: uthread_stack.c,v 1.2 1999/11/25 19:00:19 deraadt Exp $ */ +/* $OpenBSD: uthread_stack.c,v 1.3 1999/11/26 00:53:21 d Exp $ */ +/* David Leonard 1999. /* * Thread stack allocation. @@ -28,7 +29,7 @@ _thread_stack_alloc(base, size) int nbpg = getpagesize(); /* Maintain a queue of default-sized stacks that we can re-use. */ - if (size == PTHREAD_STACK_DEFAULT) { + if (base == NULL && size == PTHREAD_STACK_DEFAULT) { if (pthread_mutex_lock(&_gc_mutex) != 0) PANIC("Cannot lock gc mutex"); diff --git a/lib/libpthread/uthread/uthread_stack.c b/lib/libpthread/uthread/uthread_stack.c index 43cbf7cc519..4cc69718111 100644 --- a/lib/libpthread/uthread/uthread_stack.c +++ b/lib/libpthread/uthread/uthread_stack.c @@ -1,4 +1,5 @@ -/* $OpenBSD: uthread_stack.c,v 1.2 1999/11/25 19:00:19 deraadt Exp $ */ +/* $OpenBSD: uthread_stack.c,v 1.3 1999/11/26 00:53:21 d Exp $ */ +/* David Leonard 1999. /* * Thread stack allocation. @@ -28,7 +29,7 @@ _thread_stack_alloc(base, size) int nbpg = getpagesize(); /* Maintain a queue of default-sized stacks that we can re-use. */ - if (size == PTHREAD_STACK_DEFAULT) { + if (base == NULL && size == PTHREAD_STACK_DEFAULT) { if (pthread_mutex_lock(&_gc_mutex) != 0) PANIC("Cannot lock gc mutex"); -- cgit v1.2.3