mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
Allow a single-threaded program to cancel itself
There is nothing in the POSIX specification to disallow a single-threaded program from cancelling itself, so we forcibly enable multiple_threads to allow the next available cancellation point in the thread to run. Also added additional tests to cover various cancellation scenarios.
This commit is contained in:
@ -32,7 +32,9 @@ size_t __default_stacksize attribute_hidden
|
||||
int __is_smp attribute_hidden;
|
||||
|
||||
#ifndef TLS_MULTIPLE_THREADS_IN_TCB
|
||||
/* Variable set to a nonzero value if more than one thread runs or ran. */
|
||||
/* Variable set to a nonzero value either if more than one thread runs or ran,
|
||||
or if a single-threaded process is trying to cancel itself. See
|
||||
nptl/descr.h for more context on the single-threaded process case. */
|
||||
int __pthread_multiple_threads attribute_hidden;
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user