Gatt arbiter: use RwLock to allow global cleanup
The test for this code is flaky and never works on the first iteration but works on the second attempt. This is because the crash is cleaning the bluetooth stack and let the arbiter be set a second time. The proper fix is to clean the arbiter when the stack is shut down, but being a OnceCell prevent it. Option 1 to solve it is to no longer use a OnceCell but a optional value that will require a lock to be shared across multiples caller. Option 2 is to have a mutable OnceCell but this looks like an anti-pattern The cost of this CL is an added rwlock when doing a call on the arbiter Bug: 287403942 Test: atest net_test_bluetooth.GattTest.GattServerBuild Change-Id: Ibe70e51dcdade64570ff95894aad21f5bd35a109
Loading
Please register or sign in to comment