From e4235d70672d9751d7718ddc2b52d0b426430768 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 16 Feb 2019 09:13:45 -0500 Subject: 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). --- src/internal/pthread_impl.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/internal') 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; -- cgit v1.2.1