OSDN Git Service

Merge "Raise alarm callback thread priority" into mnc-dr-dev am: 2c8802ab5f
authorAndre Eisenbach <eisenbach@google.com>
Sat, 24 Oct 2015 00:15:13 +0000 (00:15 +0000)
committerandroid-build-merger <android-build-merger@google.com>
Sat, 24 Oct 2015 00:15:13 +0000 (00:15 +0000)
am: 20cca2ff6b

* commit '20cca2ff6b7cb02d26d1e60bbe0303f14e7be3d4':
  Raise alarm callback thread priority

1  2 
osi/src/alarm.c

diff --cc osi/src/alarm.c
@@@ -241,12 -252,35 +248,13 @@@ static bool lazy_initialize(void) 
    callback_thread_active = true;
    callback_thread = thread_new("alarm_callbacks");
    if (!callback_thread) {
 -    LOG_ERROR("%s unable to create alarm callback thread.", __func__);
 -    goto error;
 +    LOG_ERROR(LOG_TAG, "%s unable to create alarm callback thread.", __func__);
 +    return false;
    }
  
+   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) {