Implement boost and stl mutexes and atomics.

This commit is contained in:
Shyotl
2014-09-07 17:18:55 -05:00
parent aeeca6e2c0
commit 37c7a72505
22 changed files with 583 additions and 483 deletions

View File

@@ -440,7 +440,7 @@ void AIStateMachine::multiplex(event_type event)
// our need to run (by us having set need_run), so there is no need to run
// ourselves.
llassert(!mMultiplexMutex.isSelfLocked()); // We may never enter recursively!
if (!mMultiplexMutex.tryLock())
if (!mMultiplexMutex.try_lock())
{
Dout(dc::statemachine(mSMDebug), "Leaving because it is already being run [" << (void*)this << "]");
return;
@@ -762,7 +762,7 @@ void AIStateMachine::multiplex(event_type event)
//=========================================
// Release the lock on mMultiplexMutex *first*, before releasing the lock on mState,
// to avoid to ever call the tryLock() and fail, while this thread isn't still
// to avoid to ever call the try_lock() and fail, while this thread isn't still
// BEFORE the critical area of mState!
mMultiplexMutex.unlock();
@@ -1262,7 +1262,7 @@ void AIStateMachine::abort(void)
multiplex(insert_abort);
}
// Block until the current run finished.
if (!mRunMutex.tryLock())
if (!mRunMutex.try_lock())
{
llwarns << "AIStateMachine::abort() blocks because the statemachine is still executing code in another thread." << llendl;
mRunMutex.lock();