1
0
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:
Siddhesh Poyarekar
2012-05-15 09:41:27 +05:30
parent 2949684c16
commit 439bf404b8
13 changed files with 300 additions and 11 deletions

View File

@ -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