Added TODO regarding serious locking problem.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28192 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -127,6 +127,10 @@ public:
|
|||||||
queueLocker->Unlock();
|
queueLocker->Unlock();
|
||||||
|
|
||||||
InterruptsSpinLocker _(gThreadSpinlock);
|
InterruptsSpinLocker _(gThreadSpinlock);
|
||||||
|
// TODO: We've got a serious race condition: If BlockAndUnlock() returned due to
|
||||||
|
// interruption, we will still be queued. A WakeUpThread() at this point will
|
||||||
|
// call thread_unblock() and might thus screw with our trying to re-lock the
|
||||||
|
// mutex.
|
||||||
return thread_block_locked(thread);
|
return thread_block_locked(thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -428,7 +432,7 @@ XsiMessageQueue::Insert(queued_message *message)
|
|||||||
int32 oldCount = atomic_get(&sXsiMessageCount);
|
int32 oldCount = atomic_get(&sXsiMessageCount);
|
||||||
if (oldCount >= MAX_XSI_MESSAGE)
|
if (oldCount >= MAX_XSI_MESSAGE)
|
||||||
return true;
|
return true;
|
||||||
// If another thread updates the counter we keep
|
// If another thread updates the counter we keep
|
||||||
// iterating
|
// iterating
|
||||||
if (atomic_test_and_set(&sXsiMessageCount, oldCount + 1, oldCount)
|
if (atomic_test_and_set(&sXsiMessageCount, oldCount + 1, oldCount)
|
||||||
== oldCount)
|
== oldCount)
|
||||||
|
|||||||
@@ -144,6 +144,10 @@ public:
|
|||||||
setLocker->Unlock();
|
setLocker->Unlock();
|
||||||
|
|
||||||
InterruptsSpinLocker _(gThreadSpinlock);
|
InterruptsSpinLocker _(gThreadSpinlock);
|
||||||
|
// TODO: We've got a serious race condition: If BlockAndUnlock() returned due to
|
||||||
|
// interruption, we will still be queued. A WakeUpThread() at this point will
|
||||||
|
// call thread_unblock() and might thus screw with our trying to re-lock the
|
||||||
|
// mutex.
|
||||||
return thread_block_locked(thread);
|
return thread_block_locked(thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -840,8 +844,8 @@ _user_xsi_semctl(int semaphoreID, int semaphoreNumber, int command,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Lock the semaphore set itself and release both the semaphore
|
// Lock the semaphore set itself and release both the semaphore
|
||||||
// set hash table lock and the ipc hash table lock _only_ if
|
// set hash table lock and the ipc hash table lock _only_ if
|
||||||
// the command it's not IPC_RMID, this prevents undesidered
|
// the command it's not IPC_RMID, this prevents undesidered
|
||||||
// situation from happening while (hopefully) improving the
|
// situation from happening while (hopefully) improving the
|
||||||
// concurrency.
|
// concurrency.
|
||||||
MutexLocker setLocker;
|
MutexLocker setLocker;
|
||||||
|
|||||||
Reference in New Issue
Block a user