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:
parent
471844b258
commit
8a05bb865f
@ -127,6 +127,10 @@ public:
|
||||
queueLocker->Unlock();
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@ -428,7 +432,7 @@ XsiMessageQueue::Insert(queued_message *message)
|
||||
int32 oldCount = atomic_get(&sXsiMessageCount);
|
||||
if (oldCount >= MAX_XSI_MESSAGE)
|
||||
return true;
|
||||
// If another thread updates the counter we keep
|
||||
// If another thread updates the counter we keep
|
||||
// iterating
|
||||
if (atomic_test_and_set(&sXsiMessageCount, oldCount + 1, oldCount)
|
||||
== oldCount)
|
||||
|
@ -144,6 +144,10 @@ public:
|
||||
setLocker->Unlock();
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@ -840,8 +844,8 @@ _user_xsi_semctl(int semaphoreID, int semaphoreNumber, int command,
|
||||
}
|
||||
|
||||
// Lock the semaphore set itself and release both the semaphore
|
||||
// set hash table lock and the ipc hash table lock _only_ if
|
||||
// the command it's not IPC_RMID, this prevents undesidered
|
||||
// set hash table lock and the ipc hash table lock _only_ if
|
||||
// the command it's not IPC_RMID, this prevents undesidered
|
||||
// situation from happening while (hopefully) improving the
|
||||
// concurrency.
|
||||
MutexLocker setLocker;
|
||||
|
Loading…
Reference in New Issue
Block a user