Revision: 1051
http://loki-lib.svn.sourceforge.net/loki-lib/?rev=1051&view=rev
Author: rich_sposato
Date: 2009-11-02 22:45:51 +0000 (Mon, 02 Nov 2009)
Log Message:
-----------
Added thread-local declaration. Replace sleep with usleep.
Modified Paths:
--------------
trunk/test/LevelMutex/ThreadPool.cpp
Modified: trunk/test/LevelMutex/ThreadPool.cpp
===================================================================
--- trunk/test/LevelMutex/ThreadPool.cpp 2009-11-02 22:40:13 UTC (rev 1050)
+++ trunk/test/LevelMutex/ThreadPool.cpp 2009-11-02 22:45:51 UTC (rev 1051)
@@ -21,6 +21,9 @@
#include <assert.h>
#include <process.h>
+#if !defined( _MSC_VER )
+ #include <unistd.h> // needed for the usleep function.
+#endif
using namespace ::std;
@@ -36,7 +39,7 @@
#endif
-volatile Thread * Thread::s_thread = nullptr;
+volatile LOKI_THREAD_LOCAL Thread * Thread::s_thread = nullptr;
// ----------------------------------------------------------------------------
@@ -94,7 +97,7 @@
#if defined( _MSC_VER )
::SleepEx( 1, true );
#else
- ::sleep( 1 );
+ ::usleep( 1000 );
#endif
}
return true;
@@ -343,7 +346,7 @@
#if defined( _MSC_VER )
::SleepEx( 1, true );
#else
- ::sleep( 1 );
+ ::usleep( 1000 );
#endif
if ( thread->m_status == Thread::Starting )
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|