Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e0db02f5 authored by Chris Manton's avatar Chris Manton
Browse files

acl_scheduler: Incorporate stop into check operation

And also fix rename comment missed in rebasing.

Bug: 349197968
Test: atest bluetooth_test_gd_unit
Flag: EXEMPT, Mechanical Refactor
Change-Id: I35da58e41304673800871bea56ad50862e1a1b2e
parent f651b455
Loading
Loading
Loading
Loading
+5 −6
Original line number Original line Diff line number Diff line
@@ -162,7 +162,10 @@ struct AclScheduler::impl {
  void Stop() { stopped_ = true; }
  void Stop() { stopped_ = true; }


private:
private:
  bool is_ready_to_send_next_operation() const {
  bool ready_to_send_next_operation() const {
    if (stopped_) {
      return false;
    }
    if (pending_outgoing_operations_.empty()) {
    if (pending_outgoing_operations_.empty()) {
      return false;
      return false;
    }
    }
@@ -170,11 +173,7 @@ private:
  }
  }


  void try_dequeue_next_operation() {
  void try_dequeue_next_operation() {
    if (stopped_) {
    if (ready_to_send_next_operation()) {
      return;
    }

    if (is_ready_to_send_next_operation()) {
      log::info("Pending connections is not empty; so sending next connection");
      log::info("Pending connections is not empty; so sending next connection");
      auto entry = std::move(pending_outgoing_operations_.front());
      auto entry = std::move(pending_outgoing_operations_.front());
      pending_outgoing_operations_.pop_front();
      pending_outgoing_operations_.pop_front();