projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
fix sem_close unmapping of still-referenced semaphore
[musl]
/
src
/
thread
/
synccall.c
diff --git
a/src/thread/synccall.c
b/src/thread/synccall.c
index
648a6ad
..
d58c851
100644
(file)
--- a/
src/thread/synccall.c
+++ b/
src/thread/synccall.c
@@
-63,7
+63,8
@@
void __synccall(void (*func)(void *), void *ctx)
sem_init(&target_sem, 0, 0);
sem_init(&caller_sem, 0, 0);
- if (!libc.threads_minus_1) goto single_threaded;
+ if (!libc.threads_minus_1 || __syscall(SYS_gettid) != self->tid)
+ goto single_threaded;
callback = func;
context = ctx;