Merge branch 'linux-sound' into release-3.7

This commit is contained in:
Daniel Buckmaster 2015-05-09 15:06:30 +10:00
commit d4e5b47195
2 changed files with 3 additions and 11 deletions

View file

@ -42,7 +42,7 @@ inline void dFetchAndAdd( volatile U32& ref, U32 val )
#if defined(TORQUE_OS_PS3) #if defined(TORQUE_OS_PS3)
cellAtomicAdd32( (std::uint32_t *)&ref, val ); cellAtomicAdd32( (std::uint32_t *)&ref, val );
#elif !defined(TORQUE_OS_MAC) #elif !defined(TORQUE_OS_MAC)
__sync_fetch_and_add( ( volatile long* ) &ref, val ); __sync_fetch_and_add(&ref, val );
#else #else
OSAtomicAdd32( val, (int32_t* ) &ref); OSAtomicAdd32( val, (int32_t* ) &ref);
#endif #endif
@ -53,7 +53,7 @@ inline void dFetchAndAdd( volatile S32& ref, S32 val )
#if defined(TORQUE_OS_PS3) #if defined(TORQUE_OS_PS3)
cellAtomicAdd32( (std::uint32_t *)&ref, val ); cellAtomicAdd32( (std::uint32_t *)&ref, val );
#elif !defined(TORQUE_OS_MAC) #elif !defined(TORQUE_OS_MAC)
__sync_fetch_and_add( ( volatile long* ) &ref, val ); __sync_fetch_and_add( &ref, val );
#else #else
OSAtomicAdd32( val, (int32_t* ) &ref); OSAtomicAdd32( val, (int32_t* ) &ref);
#endif #endif

View file

@ -412,15 +412,7 @@ void ThreadPool::queueWorkItem( WorkItem* item )
mWorkItemQueue.insert( item->getPriority(), item ); mWorkItemQueue.insert( item->getPriority(), item );
// Wake up some thread, if we need to. mSemaphore.release();
// Use the ready count here as the wake count does
// not correctly protect the critical section in the
// thread's run function. This may lead us to release
// the semaphore more often than necessary, but it avoids
// a race condition.
if( !dCompareAndSwap( mNumThreadsReady, mNumThreads, mNumThreads ) )
mSemaphore.release();
} }
} }