* Adding static Notify{One,All} functions. This allows a cleaner implementation
of the condition variable and synchronization subsystem of the freebsd compat layer which will be committed next. * Also there was a discussion about adding these functions on the commit mailing list. The mail in http://www.freelists.org/post/haiku-commits/r34395-in-haikutrunksrclibscompatfreebsd-network-compatsys,3 is a good sum up of it (need to scroll somewhat down, though). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34458 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -261,6 +261,34 @@ ConditionVariable::Wait(uint32 flags, bigtime_t timeout)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ConditionVariable::NotifyOne(const void* object, bool threadsLocked,
|
||||
status_t result)
|
||||
{
|
||||
InterruptsSpinLocker locker(sConditionVariablesLock);
|
||||
ConditionVariable* variable = sConditionVariableHash.Lookup(object);
|
||||
locker.Unlock();
|
||||
if (variable == NULL)
|
||||
return;
|
||||
|
||||
variable->NotifyOne(threadsLocked, result);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ConditionVariable::NotifyAll(const void* object,
|
||||
bool threadsLocked, status_t result)
|
||||
{
|
||||
InterruptsSpinLocker locker(sConditionVariablesLock);
|
||||
ConditionVariable* variable = sConditionVariableHash.Lookup(object);
|
||||
locker.Unlock();
|
||||
if (variable == NULL)
|
||||
return;
|
||||
|
||||
variable->NotifyAll(threadsLocked, result);
|
||||
}
|
||||
|
||||
|
||||
/*static*/ void
|
||||
ConditionVariable::ListAll()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user