Fix race condition in bluez discovery operations
This guards StartDiscovery from happening when StopDiscovery is still in
progress and guards StopDiscovery from happening when StartDiscovery is
still in progress.
TEST=Add intentional delay in kernel's MGMT_OP_START_DISCOVERY so race
condition can be reproduced and check that bluez returns error Busy
instead of letting the race condition happen.
Commit-Ready: Sonny Sasaka <firstname.lastname@example.org>
Tested-by: Sonny Sasaka <email@example.com>
Reviewed-by: Miao-chen Chou <firstname.lastname@example.org>
Reviewed-by: Dmitry Grinberg <email@example.com>
(cherry picked from commit 4baf6005b854802bfea07c8142179dbf31ea7561)
Reviewed-by: Sonny Sasaka <firstname.lastname@example.org>
Commit-Queue: Sonny Sasaka <email@example.com>
1 file changed