Added optional locking timeouts to help stave off deadlocks
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2180 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
457c142fdf
commit
a5dbd67b81
@ -103,9 +103,12 @@ BPoint DisplayDriver::GetHotSpot(void)
|
|||||||
// Private Methods
|
// Private Methods
|
||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
|
|
||||||
void DisplayDriver::Lock(void)
|
bool DisplayDriver::Lock(bigtime_t timeout) // defaults to B_INIFINITE_TIMEOUT
|
||||||
{
|
{
|
||||||
acquire_sem(lock_sem);
|
// acquire_sem(lock_sem);
|
||||||
|
if(acquire_sem_etc(lock_sem,1,B_RELATIVE_TIMEOUT,timeout)!=B_NO_ERROR)
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisplayDriver::Unlock(void)
|
void DisplayDriver::Unlock(void)
|
||||||
|
@ -110,7 +110,7 @@ public:
|
|||||||
BPoint GetHotSpot(void);
|
BPoint GetHotSpot(void);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void Lock(void);
|
bool Lock(bigtime_t timeout=B_INFINITE_TIMEOUT);
|
||||||
void Unlock(void);
|
void Unlock(void);
|
||||||
void SetDepthInternal(uint8 d);
|
void SetDepthInternal(uint8 d);
|
||||||
void SetHeightInternal(uint16 h);
|
void SetHeightInternal(uint16 h);
|
||||||
|
Loading…
Reference in New Issue
Block a user