system/bt
修訂 | 81d976e49d9ac717aeacb6f884a755239fcf653c (tree) |
---|---|
時間 | 2016-10-03 19:00:42 |
作者 | Linux Build Service Account <lnxbuild@loca...> |
Commiter | Gerrit - the friendly Code Review server |
Merge "BT: Serialize stack shutdown, state change callback and cleanup" into bt.lnx.2.1-dev
@@ -178,7 +178,9 @@ static void event_shut_down_stack(UNUSED_ATTR void *context) { | ||
178 | 178 | module_shut_down(get_module(CONTROLLER_MODULE)); // Doesn't do any work, just puts it in a restartable state |
179 | 179 | |
180 | 180 | LOG_INFO(LOG_TAG, "%s finished", __func__); |
181 | + hack_future = future_new(); | |
181 | 182 | btif_thread_post(event_signal_stack_down, NULL); |
183 | + future_await(hack_future); | |
182 | 184 | } |
183 | 185 | |
184 | 186 | static void ensure_stack_is_not_running(void) { |
@@ -224,6 +226,7 @@ static void event_signal_stack_up(UNUSED_ATTR void *context) { | ||
224 | 226 | |
225 | 227 | static void event_signal_stack_down(UNUSED_ATTR void *context) { |
226 | 228 | HAL_CBACK(bt_hal_cbacks, adapter_state_changed_cb, BT_STATE_OFF); |
229 | + future_ready(stack_manager_get_hack_future(), FUTURE_SUCCESS); | |
227 | 230 | } |
228 | 231 | |
229 | 232 | static void ensure_manager_initialized(void) { |