summaryrefslogtreecommitdiff
path: root/src/thread/pthread_create.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/thread/pthread_create.c')
-rw-r--r--src/thread/pthread_create.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
index ebf61ded..edaf9a6e 100644
--- a/src/thread/pthread_create.c
+++ b/src/thread/pthread_create.c
@@ -356,13 +356,14 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att
new->prev = self;
new->next->prev = new;
new->prev->next = new;
+ } else {
+ libc.threads_minus_1--;
}
__tl_unlock();
__restore_sigs(&set);
__release_ptc();
if (ret < 0) {
- libc.threads_minus_1--;
if (map) __munmap(map, size);
return EAGAIN;
}