API (Android): check whether the SIGALRM signal is erroneously being handled by the timer thread

This commit is contained in:
David Anderson 2013-08-02 13:43:58 -07:00
parent eb489c487c
commit 920df081e4
1 changed files with 7 additions and 2 deletions

View File

@ -1241,10 +1241,15 @@ static void worker_signal_handler(int) {
if (options.direct_process_action) {
while (boinc_status.suspended && in_critical_section==0) {
#ifdef ANDROID
// Suspicion that sleep() sleeps entire process
// Suspicion that per-thread signal masking doesn't work
// on old versions of Android
//
sched_yield();
if (pthread_self() == timer_thread_id) {
fprintf(stderr,
"ERROR - signal handler called in timer thread\n"
);
exit(1);
}
#endif
sleep(1); // don't use boinc_sleep() because it does FP math
}