* Fixing the panics occured when deleting ConditionVariables while still
holding the InterruptsSpinLocker. * Have to use B_RELATIVE_TIMEOUT if you want to wait for a specific period. This fixes the problem of failing firmware loading in iprowifi2200 due to always timing out before the firmware would have had the chance to actually load. * I can surf with iprowifi2200 now. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34410 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -56,9 +56,10 @@ init_condition_variables()
|
|||||||
void
|
void
|
||||||
uninit_condition_variables()
|
uninit_condition_variables()
|
||||||
{
|
{
|
||||||
InterruptsSpinLocker _(sConditionVariablesLock);
|
|
||||||
ConditionVariableHashDefinition definition;
|
ConditionVariableHashDefinition definition;
|
||||||
|
InterruptsSpinLocker hashLocker(sConditionVariablesLock);
|
||||||
ConditionVariable* variable = sConditionVariableHash.Clear(true);
|
ConditionVariable* variable = sConditionVariableHash.Clear(true);
|
||||||
|
hashLocker.Unlock();
|
||||||
|
|
||||||
while (variable != NULL) {
|
while (variable != NULL) {
|
||||||
ConditionVariable* next = definition.GetLink(variable);
|
ConditionVariable* next = definition.GetLink(variable);
|
||||||
@@ -88,9 +89,10 @@ _cv_init(const void* object, const char* description)
|
|||||||
void
|
void
|
||||||
_cv_destroy(const void* object)
|
_cv_destroy(const void* object)
|
||||||
{
|
{
|
||||||
InterruptsSpinLocker _(sConditionVariablesLock);
|
InterruptsSpinLocker hashLocker(sConditionVariablesLock);
|
||||||
ConditionVariable* conditionVariable
|
ConditionVariable* conditionVariable
|
||||||
= sConditionVariableHash.Lookup(object);
|
= sConditionVariableHash.Lookup(object);
|
||||||
|
hashLocker.Unlock();
|
||||||
if (conditionVariable == NULL)
|
if (conditionVariable == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -114,7 +116,7 @@ _cv_timedwait_unlocked(const void* object, int timeout)
|
|||||||
{
|
{
|
||||||
ConditionVariableEntry conditionVariableEntry;
|
ConditionVariableEntry conditionVariableEntry;
|
||||||
|
|
||||||
status_t status = conditionVariableEntry.Wait(object, B_ABSOLUTE_TIMEOUT,
|
status_t status = conditionVariableEntry.Wait(object, B_RELATIVE_TIMEOUT,
|
||||||
ticks_to_usecs(timeout));
|
ticks_to_usecs(timeout));
|
||||||
|
|
||||||
if (status == B_OK)
|
if (status == B_OK)
|
||||||
|
|||||||
Reference in New Issue
Block a user