I made some revisions to David Kim's code and put it in a branch:
https://github.com/BOINC/boinc/tree/android_api_dpa

The main changes:

- I added and fixed comments about the thread/signal structure

- In exit_from_timer_thread():
  removed the "boinc_status.suspended = false" and the first "sleep(2.0)".
  I don't see why either of these is needed.

- in timer_handler():
  If detect heartbeat failure, don't bother sending signal to work thread;
  exit_from_timer_thread() already does this.

- in worker_signal_handler, don't bother checking that we're the timer thread.
  Now that we use pthread_kill() instead of setitimer(),this will always be the 
case.

- I didn't include the stuff about debugging using external signals.
  That's a good idea, but there's a simpler way to do it:
  have the API look for control messages in a file instead of shared memory.
  e.g. you could tell the app to quit by writing <quit/> to the file.
  This would work on Win too.
  (I didn't add this, but will on request; it's a two-line change)

- didn't include the "in_critical_section > 0" changes; not needed.

David K, can you take a look at this and see if it's OK?

Thanks -- David
_______________________________________________
boinc_dev mailing list
boinc_dev@ssl.berkeley.edu
https://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev
To unsubscribe, visit the above URL and
(near bottom of page) enter your email address.

Reply via email to