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

Commit 80c5feae authored by Patty's avatar Patty
Browse files

Use atomic variable to avoid race condition

iso_credits_ will be modified by two threads, change to use
atomic to let the value become thread safe.

Tag: #refactor
Bug: 211078908
Bug: 150670922
Test: Playing music and the iso_credits_ should not run out.

Change-Id: I08afee7c1ee163896f721ce1087ae631de71ff3f
parent fd0d1bd9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -731,7 +731,7 @@ struct iso_impl {
  std::map<uint16_t, std::unique_ptr<iso_cis>> conn_hdl_to_cis_map_;
  std::map<uint16_t, std::unique_ptr<iso_bis>> conn_hdl_to_bis_map_;

  uint16_t iso_credits_;
  std::atomic_uint16_t iso_credits_;
  uint16_t iso_buffer_size_;
  uint32_t last_big_create_req_sdu_itv_;