OSDN Git Service

BT: Use static lock to avoid race while cleanup
authorGurpreet Ghai <gghai@codeaurora.org>
Sun, 20 Aug 2017 08:52:27 +0000 (14:22 +0530)
committerMyles Watson <mylesgw@google.com>
Thu, 9 Nov 2017 20:10:42 +0000 (20:10 +0000)
commitf5047f42c42409565d4d81d682df0b4a3dcfebec
tree1a98f49e464e3d092031a82c40696604c542f534
parent325abcfa4a039aa6cb0c7a350c11daacd3cc9b62
BT: Use static lock to avoid race while cleanup

Problem:
The functions protected by mutex lock are called after cleanup
during shutdown. During this race condition, the structure set does not
exist and cause crash.

Steps:
Bluetooth on/off automation

Failure:
Bluetooth process crashes

RootCause:
Mutex is accessed after it is destroyed because of other thread calling
the function.

Fix:
Changed mutex lock to static type so that it exist and protect
the set structure even after cleanup.

Test: manual

Bug: 66921327

Change-Id: I8d1f5d5d607100ab73aec722a27688dae45cc323
btif/src/btif_uid.cc