path: root/src/internal/pthread_impl.h
diff options
authorRich Felker <>2019-02-16 09:13:45 -0500
committerRich Felker <>2019-02-16 10:11:22 -0500
commite4235d70672d9751d7718ddc2b52d0b426430768 (patch)
treecf4d965f2a440b641adca6fd3ddf5f17278e3210 /src/internal/pthread_impl.h
parent8f11e6127fe93093f81a52b15bb1537edc3fc8af (diff)
rewrite __synccall in terms of global thread list
the __synccall mechanism provides stop-the-world synchronous execution of a callback in all threads of the process. it is used to implement multi-threaded setuid/setgid operations, since Linux lacks them at the kernel level, and for some other less-critical purposes. this change eliminates dependency on /proc/self/task to determine the set of live threads, which in addition to being an unwanted dependency and a potential point of resource-exhaustion failure, turned out to be inaccurate. test cases provided by Alexey Izbyshev showed that it could fail to reflect newly created threads. due to how the presignaling phase worked, this usually yielded a deadlock if hit, but in the worst case it could also result in threads being silently missed (allowed to continue running without executing the callback).
Diffstat (limited to 'src/internal/pthread_impl.h')
1 files changed, 0 insertions, 1 deletions
diff --git a/src/internal/pthread_impl.h b/src/internal/pthread_impl.h
index 508b40b5..d5d969ec 100644
--- a/src/internal/pthread_impl.h
+++ b/src/internal/pthread_impl.h
@@ -139,7 +139,6 @@ hidden void __pthread_tsd_run_dtors();
hidden void __pthread_key_delete_synccall(void (*)(void *), void *);
hidden int __pthread_key_delete_impl(pthread_key_t);
-extern hidden volatile int __block_new_threads;
extern hidden volatile size_t __pthread_tsd_size;
extern hidden void *__pthread_tsd_main[];
extern hidden volatile int __aio_fut;