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 <email@example.com>
Tested-by: Sonny Sasaka <firstname.lastname@example.org>
Reviewed-by: Miao-chen Chou <email@example.com>
Reviewed-by: Dmitry Grinberg <firstname.lastname@example.org>
(cherry picked from commit 4baf6005b854802bfea07c8142179dbf31ea7561)
Reviewed-by: Sonny Sasaka <email@example.com>
Commit-Queue: Sonny Sasaka <firstname.lastname@example.org>
1 file changed