summaryrefslogtreecommitdiffstats
path: root/lib/librthread/rthread_stack.c
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2017-09-05 02:40:54 +0000
committerguenther <guenther@openbsd.org>2017-09-05 02:40:54 +0000
commita5511fa9f431600dbd6dc2b46fc4e6b73e7d239c (patch)
treebf9e27f29ab35e6599d4c1362a9902d7e7bfdc74 /lib/librthread/rthread_stack.c
parentSerialize access to IP reassembly queue with a mutex. This lets (diff)
downloadwireguard-openbsd-a5511fa9f431600dbd6dc2b46fc4e6b73e7d239c.tar.xz
wireguard-openbsd-a5511fa9f431600dbd6dc2b46fc4e6b73e7d239c.zip
Move mutex, condvar, and thread-specific data routes, pthread_once, and
pthread_exit from libpthread to libc, along with low-level bits to support them. Major bump to both libc and libpthread. Requested by libressl team. Ports testing by naddy@ ok kettenis@
Diffstat (limited to 'lib/librthread/rthread_stack.c')
-rw-r--r--lib/librthread/rthread_stack.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/librthread/rthread_stack.c b/lib/librthread/rthread_stack.c
index 6d3ab3a9b7b..f40ca006c86 100644
--- a/lib/librthread/rthread_stack.c
+++ b/lib/librthread/rthread_stack.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rthread_stack.c,v 1.16 2016/09/04 10:13:35 akfaew Exp $ */
+/* $OpenBSD: rthread_stack.c,v 1.17 2017/09/05 02:40:54 guenther Exp $ */
/* PUBLIC DOMAIN: No Rights Reserved. Marco S Hyman <marc@snafu.org> */
@@ -33,7 +33,7 @@ _rthread_alloc_stack(pthread_t thread)
/* if the request uses the defaults, try to reuse one */
if (thread->attr.stack_addr == NULL &&
thread->attr.stack_size == RTHREAD_STACK_SIZE_DEF &&
- thread->attr.guard_size == _rthread_attr_default.guard_size) {
+ thread->attr.guard_size == _thread_pagesize) {
_spinlock(&def_stacks_lock);
stack = SLIST_FIRST(&def_stacks);
if (stack != NULL) {
@@ -123,7 +123,7 @@ void
_rthread_free_stack(struct stack *stack)
{
if (stack->len == RTHREAD_STACK_SIZE_DEF + stack->guardsize &&
- stack->guardsize == _rthread_attr_default.guard_size) {
+ stack->guardsize == _thread_pagesize) {
_spinlock(&def_stacks_lock);
SLIST_INSERT_HEAD(&def_stacks, stack, link);
_spinunlock(&def_stacks_lock);