API (Android) sched_yield() before sleep() in signal handler

Trying to fix bug where timer thread stops doing anything
after first suspend on Android (old, 1-core devices).
I suspect that the sleep() in the worker thread's signal handle
is sleeping the entire process.
Insert a sched_yield() before the sleep so that the time thread will run.
This commit is contained in:
David Anderson 2013-07-30 11:04:09 -07:00
parent e85a18289e
commit 9eb232ab08
1 changed files with 5 additions and 0 deletions

View File

@ -1240,7 +1240,12 @@ 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
// on old versions of Android
//
sched_yield();
#endif
sleep(1); // don't use boinc_sleep() because it does FP math
}
}