Loading system/gd/hci/hci_layer.cc +0 −6 Original line number Diff line number Diff line Loading @@ -234,12 +234,6 @@ struct HciLayer::impl : public hal::HciHalCallbacks { void Stop() { hal_->unregisterIncomingPacketCallback(); UnregisterEventHandler(EventCode::COMMAND_COMPLETE); UnregisterEventHandler(EventCode::COMMAND_STATUS); UnregisterEventHandler(EventCode::LE_META_EVENT); UnregisterEventHandler(EventCode::PAGE_SCAN_REPETITION_MODE_CHANGE); UnregisterEventHandler(EventCode::MAX_SLOTS_CHANGE); UnregisterEventHandler(EventCode::VENDOR_SPECIFIC); acl_queue_.GetDownEnd()->UnregisterDequeue(); incoming_acl_packet_buffer_.Clear(); Loading system/gd/os/linux_generic/reactor.cc +4 −3 Original line number Diff line number Diff line Loading @@ -105,6 +105,7 @@ void Reactor::Run() { } auto* reactable = static_cast<Reactor::Reactable*>(event.data.ptr); std::unique_lock<std::mutex> lock(mutex_); executing_reactable_finished_ = nullptr; // See if this reactable has been removed in the meantime. if (std::find(invalidation_list_.begin(), invalidation_list_.end(), reactable) != invalidation_list_.end()) { continue; Loading Loading @@ -194,11 +195,11 @@ void Reactor::Unregister(Reactor::Reactable* reactable) { bool Reactor::WaitForUnregisteredReactable(std::chrono::milliseconds timeout) { std::lock_guard<std::mutex> lock(mutex_); if (executing_reactable_finished_ == nullptr) { std::shared_ptr<std::future<void>> reactable_finished_future = executing_reactable_finished_; if (reactable_finished_future == nullptr) { return true; } auto stop_status = executing_reactable_finished_->wait_for(timeout); executing_reactable_finished_ = nullptr; auto stop_status = reactable_finished_future->wait_for(timeout); if (stop_status != std::future_status::ready) { LOG_ERROR("Unregister reactable timed out"); } Loading system/gd/os/reactor.h +1 −1 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ class Reactor { int control_fd_; std::atomic<bool> is_running_; std::list<Reactable*> invalidation_list_; std::unique_ptr<std::future<void>> executing_reactable_finished_; std::shared_ptr<std::future<void>> executing_reactable_finished_; }; } // namespace os Loading Loading
system/gd/hci/hci_layer.cc +0 −6 Original line number Diff line number Diff line Loading @@ -234,12 +234,6 @@ struct HciLayer::impl : public hal::HciHalCallbacks { void Stop() { hal_->unregisterIncomingPacketCallback(); UnregisterEventHandler(EventCode::COMMAND_COMPLETE); UnregisterEventHandler(EventCode::COMMAND_STATUS); UnregisterEventHandler(EventCode::LE_META_EVENT); UnregisterEventHandler(EventCode::PAGE_SCAN_REPETITION_MODE_CHANGE); UnregisterEventHandler(EventCode::MAX_SLOTS_CHANGE); UnregisterEventHandler(EventCode::VENDOR_SPECIFIC); acl_queue_.GetDownEnd()->UnregisterDequeue(); incoming_acl_packet_buffer_.Clear(); Loading
system/gd/os/linux_generic/reactor.cc +4 −3 Original line number Diff line number Diff line Loading @@ -105,6 +105,7 @@ void Reactor::Run() { } auto* reactable = static_cast<Reactor::Reactable*>(event.data.ptr); std::unique_lock<std::mutex> lock(mutex_); executing_reactable_finished_ = nullptr; // See if this reactable has been removed in the meantime. if (std::find(invalidation_list_.begin(), invalidation_list_.end(), reactable) != invalidation_list_.end()) { continue; Loading Loading @@ -194,11 +195,11 @@ void Reactor::Unregister(Reactor::Reactable* reactable) { bool Reactor::WaitForUnregisteredReactable(std::chrono::milliseconds timeout) { std::lock_guard<std::mutex> lock(mutex_); if (executing_reactable_finished_ == nullptr) { std::shared_ptr<std::future<void>> reactable_finished_future = executing_reactable_finished_; if (reactable_finished_future == nullptr) { return true; } auto stop_status = executing_reactable_finished_->wait_for(timeout); executing_reactable_finished_ = nullptr; auto stop_status = reactable_finished_future->wait_for(timeout); if (stop_status != std::future_status::ready) { LOG_ERROR("Unregister reactable timed out"); } Loading
system/gd/os/reactor.h +1 −1 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ class Reactor { int control_fd_; std::atomic<bool> is_running_; std::list<Reactable*> invalidation_list_; std::unique_ptr<std::future<void>> executing_reactable_finished_; std::shared_ptr<std::future<void>> executing_reactable_finished_; }; } // namespace os Loading