mirror of
https://review.haiku-os.org/haiku
synced 2025-01-31 18:56:49 +01:00
* 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:
parent
43d5e9c5d1
commit
c52bedd831
@ -100,12 +100,16 @@ PowerStatusDriverInterface::StartWatching(BHandler* target)
|
||||
status_t
|
||||
PowerStatusDriverInterface::StopWatching(BHandler* target)
|
||||
{
|
||||
BAutolock autolock(fListLocker);
|
||||
if (fThread < 0)
|
||||
return B_BAD_VALUE;
|
||||
|
||||
if (fWatcherList.CountItems() == 1)
|
||||
fListLocker.Lock();
|
||||
|
||||
if (fWatcherList.CountItems() == 1) {
|
||||
fListLocker.Unlock();
|
||||
Disconnect();
|
||||
} else
|
||||
fListLocker.Unlock();
|
||||
|
||||
return Monitor::StopWatching(target);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user