summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavlin Radoslavov <pavlin@google.com>2016-04-19 19:16:26 -0700
committerPavlin Radoslavov <pavlin@google.com>2016-04-22 15:55:39 -0700
commitf338fb754e00d51c31c96f755b05d8daf6006168 (patch)
tree5590b0ce3e4f2c678f589bd3743536e51cec9d7a
parent4d602cc8c972c781ba23e7945a2dcd20fee40de3 (diff)
downloadandroid-system-bt-f338fb754e00d51c31c96f755b05d8daf6006168.tar.gz
android-system-bt-f338fb754e00d51c31c96f755b05d8daf6006168.tar.xz
Add missing mutex lock/unlock inside alarm_cleanup()
Bug: 26982349 Change-Id: I32f4e6450491adcc1e12e71fb8bb582d6397a91a
-rw-r--r--osi/src/alarm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/osi/src/alarm.c b/osi/src/alarm.c
index 2a115e6..d070678 100644
--- a/osi/src/alarm.c
+++ b/osi/src/alarm.c
@@ -292,6 +292,8 @@ void alarm_cleanup(void) {
if (!alarms)
return;
+ pthread_mutex_lock(&monitor);
+
dispatcher_thread_active = false;
semaphore_post(alarm_expired);
thread_free(dispatcher_thread);
@@ -308,6 +310,7 @@ void alarm_cleanup(void) {
list_free(alarms);
alarms = NULL;
+ pthread_mutex_unlock(&monitor);
pthread_mutex_destroy(&monitor);
}