Bug 972249: Remove |sGetPropertyMonitor|, r=echou

This bug has probably been solved by bug 983576, so we can remove
the extra locking.
This commit is contained in:
Thomas Zimmermann 2014-04-03 13:01:09 +02:00
parent 16f2f5f714
commit dc1661df84

View File

@ -329,9 +329,8 @@ static nsString sAdapterPath;
*/
static int sConnectedDeviceCount = 0;
// sStopBluetoothMonitor protects sGetPropertyMonitor. TODO: should be reviewed
// sStopBluetoothMonitor protects sConectedDeviceCount. TODO: should be reviewed
// and replaced or implemented with Atomic<>.
static StaticAutoPtr<Monitor> sGetPropertyMonitor;
static StaticAutoPtr<Monitor> sStopBluetoothMonitor;
// A queue for connect/disconnect request. See Bug 913372 for details.
@ -368,14 +367,12 @@ DispatchToBtThread(nsIRunnable* aRunnable)
BluetoothDBusService::BluetoothDBusService()
{
sGetPropertyMonitor = new Monitor("BluetoothService.sGetPropertyMonitor");
sStopBluetoothMonitor = new Monitor("BluetoothService.sStopBluetoothMonitor");
}
BluetoothDBusService::~BluetoothDBusService()
{
sStopBluetoothMonitor = nullptr;
sGetPropertyMonitor = nullptr;
}
static bool
@ -814,14 +811,6 @@ GetProperty(DBusMessageIter aIter, const Properties* aPropertyTypes,
int aPropertyTypeLen, int* aPropIndex,
InfallibleTArray<BluetoothNamedValue>& aProperties)
{
/**
* Ensure GetProperty runs in critical section otherwise
* crash due to timing issue occurs when BT is enabled.
*
* TODO: Revise GetProperty to solve the crash
*/
MonitorAutoLock lock(*sGetPropertyMonitor);
DBusMessageIter prop_val, array_val_iter;
char* property = nullptr;
uint32_t array_type;