//------------------------------------------------------------------------ void ResourceBackgroundQueue::initialise(void) { #if OGRE_THREAD_SUPPORT if (mStartThread) { { OGRE_LOCK_AUTO_MUTEX mShuttingDown = false; } #if OGRE_THREAD_SUPPORT == 1 RenderSystem* rs = Root::getSingleton().getRenderSystem(); #endif LogManager::getSingleton().logMessage( "ResourceBackgroundQueue - threading enabled, starting own thread"); { OGRE_LOCK_MUTEX_NAMED(initMutex, initLock) #if OGRE_THREAD_SUPPORT == 1 // Call thread creation pre-hook rs->preExtraThreadsStarted(); #endif mThread = OGRE_NEW_T(boost::thread, MEMCATEGORY_RESOURCE)( boost::function0<void>(&ResourceBackgroundQueue::threadFunc)); // Wait for init to finish before allowing main thread to continue // this releases the initMutex until notified OGRE_THREAD_WAIT(initSync, initLock) #if OGRE_THREAD_SUPPORT == 1 // Call thread creation post-hook rs->postExtraThreadsStarted(); #endif } } else { LogManager::getSingleton().logMessage( "ResourceBackgroundQueue - threading enabled, user thread"); } #else LogManager::getSingleton().logMessage( "ResourceBackgroundQueue - threading disabled"); #endif }