* Fixed a deadlock that often happened when installing PowerStatus to the
Deskbar. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32259 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -100,12 +100,16 @@ PowerStatusDriverInterface::StartWatching(BHandler* target)
|
|||||||
status_t
|
status_t
|
||||||
PowerStatusDriverInterface::StopWatching(BHandler* target)
|
PowerStatusDriverInterface::StopWatching(BHandler* target)
|
||||||
{
|
{
|
||||||
BAutolock autolock(fListLocker);
|
|
||||||
if (fThread < 0)
|
if (fThread < 0)
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
if (fWatcherList.CountItems() == 1)
|
fListLocker.Lock();
|
||||||
|
|
||||||
|
if (fWatcherList.CountItems() == 1) {
|
||||||
|
fListLocker.Unlock();
|
||||||
Disconnect();
|
Disconnect();
|
||||||
|
} else
|
||||||
|
fListLocker.Unlock();
|
||||||
|
|
||||||
return Monitor::StopWatching(target);
|
return Monitor::StopWatching(target);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user