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)
committerPavlin Radoslavov <pavlin@google.com>
Tue, 26 Apr 2016 15:28:01 +0000 (15:28 +0000)
commit93342476cae97c085e3f274a8bf1339b523f7132
treefdf5b7e0adbf4f5a45913b8f320c5b9e186adb68
parentf1c12e5e648bd1dcb2d0ecb935012ca063249e73
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