OSDN Git Service

Enable kernel wakelocks and timers am: 28bf007f71
authorMarie Janssen <jamuraa@google.com>
Tue, 27 Oct 2015 23:20:54 +0000 (23:20 +0000)
committerandroid-build-merger <android-build-merger@google.com>
Tue, 27 Oct 2015 23:20:54 +0000 (23:20 +0000)
am: 77680a2b16

* commit '77680a2b1622ccf356e97eb08f90d55023ea434c':
  Enable kernel wakelocks and timers

1  2 
osi/src/alarm.c

diff --cc osi/src/alarm.c
@@@ -249,12 -259,33 +266,34 @@@ static bool lazy_initialize(void) 
    callback_thread = thread_new("alarm_callbacks");
    if (!callback_thread) {
      LOG_ERROR(LOG_TAG, "%s unable to create alarm callback thread.", __func__);
-     return false;
+     goto error;
    }
  
 +  thread_set_priority(callback_thread, CALLBACK_THREAD_PRIORITY_HIGH);
    thread_post(callback_thread, callback_dispatch, NULL);
    return true;
+ error:
+   thread_free(callback_thread);
+   callback_thread = NULL;
+   callback_thread_active = false;
+   semaphore_free(alarm_expired);
+   alarm_expired = NULL;
+   if (wakeup_timer_initialized)
+     timer_delete(wakeup_timer);
+   if (timer_initialized)
+     timer_delete(timer);
+   list_free(alarms);
+   alarms = NULL;
+   pthread_mutex_destroy(&monitor);
+   return false;
  }
  
  static period_ms_t now(void) {