Use SIGUSR2 for SIG_CANCEL on Android
SIGRTMIN is defined as 32 while sigset_t is defined as unsigned long (i.e. holds 32 signals). Hence, the signal could never be blocked. Sending the signal still canceled threads, but sometimes in situations where they shouldn't have been canceled (e.g. while holding a lock). Fixes #298.
This commit is contained in:
parent
0ac34e9e6a
commit
bc07fef09c
1 changed files with 4 additions and 0 deletions
|
@ -129,7 +129,11 @@ static thread_value_t *current_thread;
|
|||
|
||||
#ifndef HAVE_PTHREAD_CANCEL
|
||||
/* if pthread_cancel is not available, we emulate it using a signal */
|
||||
#ifdef ANDROID
|
||||
#define SIG_CANCEL SIGUSR2
|
||||
#else
|
||||
#define SIG_CANCEL (SIGRTMIN+7)
|
||||
#endif
|
||||
|
||||
/* the signal handler for SIG_CANCEL uses pthread_exit to terminate the
|
||||
* "cancelled" thread */
|
||||
|
|
Loading…
Reference in a new issue