OSDN Git Service

Fix a race condition during alarm_cleanup()
authorPavlin Radoslavov <pavlin@google.com>
Mon, 25 Apr 2016 19:29:29 +0000 (12:29 -0700)
committerAndre Eisenbach <eisenbach@google.com>
Mon, 25 Apr 2016 21:40:53 +0000 (21:40 +0000)
commit97ec0a56f5282ee8977bc1dcb60bb86980e757d6
tree7245e58712df5ba57a8e48f6ce3351f6b467c742
parent3165425aff5744bf682a2887e9704e66f8d34a87
Fix a race condition during alarm_cleanup()

Fix a race condition inside function alarm_cleanup() that
could be triggered during shutdown.

Also, fix few other issues:
 * Add missing "timer_delete(akeup_timer)" statement inside
   alarm_cleanup()
 * Fix the argument when calling "timer_delete(timer)"
 * Call "semaphore_free(alarm_expired)" inside alarm_cleanup()
   after the corresponding "timer" and "wakeup_timer" have
   been deleted.
 * Fix the argument type when calling eventfd_read() inside
   semaphore_wait()

Bug: 26982349
Change-Id: I2b00cd7ee7f56f755775f8e7b370006e31c6eb08
osi/src/alarm.c
osi/src/semaphore.c