From ae4ac53592b2949eeeda73ebf36fdad55a6fae61 Mon Sep 17 00:00:00 2001 From: Daniel Buckmaster Date: Sat, 9 May 2015 15:02:41 +1000 Subject: [PATCH] Remove comments. --- Engine/source/platform/platformIntrinsics.gcc.h | 2 -- Engine/source/platform/threads/threadPool.cpp | 13 +------------ 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/Engine/source/platform/platformIntrinsics.gcc.h b/Engine/source/platform/platformIntrinsics.gcc.h index 17b6ad7dd..115d62e6c 100644 --- a/Engine/source/platform/platformIntrinsics.gcc.h +++ b/Engine/source/platform/platformIntrinsics.gcc.h @@ -42,7 +42,6 @@ inline void dFetchAndAdd( volatile U32& ref, U32 val ) #if defined(TORQUE_OS_PS3) cellAtomicAdd32( (std::uint32_t *)&ref, val ); #elif !defined(TORQUE_OS_MAC) - //__sync_fetch_and_add( ( volatile long* ) &ref, val ); __sync_fetch_and_add(&ref, val ); #else OSAtomicAdd32( val, (int32_t* ) &ref); @@ -54,7 +53,6 @@ inline void dFetchAndAdd( volatile S32& ref, S32 val ) #if defined(TORQUE_OS_PS3) cellAtomicAdd32( (std::uint32_t *)&ref, val ); #elif !defined(TORQUE_OS_MAC) - //__sync_fetch_and_add( ( volatile long* ) &ref, val ); __sync_fetch_and_add( &ref, val ); #else OSAtomicAdd32( val, (int32_t* ) &ref); diff --git a/Engine/source/platform/threads/threadPool.cpp b/Engine/source/platform/threads/threadPool.cpp index f4f5cfef1..5b96b495b 100644 --- a/Engine/source/platform/threads/threadPool.cpp +++ b/Engine/source/platform/threads/threadPool.cpp @@ -412,18 +412,7 @@ void ThreadPool::queueWorkItem( WorkItem* item ) mWorkItemQueue.insert( item->getPriority(), item ); - // Wake up some thread, if we need to. - // 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. - - //Wasn't there still a race condition? Why not rely entirely on the semaphore? - //For example, mNumThreadsReady initializes equalto mNumThreads, which could cause - //initial work items to hang. - //if( !dCompareAndSwap( mNumThreadsReady, mNumThreads, mNumThreads ) ) - mSemaphore.release(); + mSemaphore.release(); } }