Index: src/Thread.cpp |
=================================================================== |
--- a/src/Thread.cpp |
+++ b/src/Thread.cpp |
@@ -10,7 +10,7 @@ |
} |
} |
-Thread::Mutex::Mutex() |
+Mutex::Mutex() |
{ |
#ifdef WIN32 |
InitializeCriticalSection(&nativeMutex); |
@@ -19,9 +19,8 @@ |
#endif |
} |
-Thread::Mutex::~Mutex() |
+Mutex::~Mutex() |
{ |
- Unlock(); |
#ifdef WIN32 |
DeleteCriticalSection(&nativeMutex); |
#else |
@@ -29,7 +28,7 @@ |
#endif |
} |
-void Thread::Mutex::Lock() |
+void Mutex::Lock() |
{ |
#ifdef WIN32 |
EnterCriticalSection(&nativeMutex); |
@@ -38,7 +37,7 @@ |
#endif |
} |
-void Thread::Mutex::Unlock() |
+void Mutex::Unlock() |
{ |
#ifdef WIN32 |
LeaveCriticalSection(&nativeMutex); |
@@ -47,7 +46,7 @@ |
#endif |
} |
-Thread::Condition::Condition() |
+ConditionVariable::ConditionVariable() |
{ |
#ifdef WIN32 |
InitializeConditionVariable(&nativeCondition); |
@@ -56,15 +55,14 @@ |
#endif |
} |
-Thread::Condition::~Condition() |
+ConditionVariable::~ConditionVariable() |
{ |
#ifndef WIN32 |
- Signal(); |
pthread_cond_destroy(&nativeCondition); |
#endif |
} |
-void Thread::Condition::Wait(Thread::Mutex& mutex) |
+void ConditionVariable::Wait(Mutex& mutex) |
{ |
#ifdef WIN32 |
SleepConditionVariableCS(&nativeCondition, &mutex.nativeMutex, INFINITE); |
@@ -73,7 +71,7 @@ |
#endif |
} |
-void Thread::Condition::Signal() |
+void ConditionVariable::Signal() |
{ |
#ifdef WIN32 |
WakeConditionVariable(&nativeCondition); |
@@ -89,17 +87,17 @@ |
void Thread::Start() |
{ |
#ifdef WIN32 |
- thread = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)&CallRun, this, 0, 0); |
+ nativeThread = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)&CallRun, this, 0, 0); |
#else |
- pthread_create(&thread, 0, (void *(*)(void*)) &CallRun, this); |
+ pthread_create(&nativeThread, 0, (void *(*)(void*)) &CallRun, this); |
#endif |
} |
void Thread::Join() |
{ |
#ifdef WIN32 |
- WaitForSingleObject(thread, INFINITE); |
+ WaitForSingleObject(nativeThread, INFINITE); |
#else |
- pthread_join(thread, 0); |
+ pthread_join(nativeThread, 0); |
#endif |
} |