|
@@ -26,7 +26,7 @@ Critical::~Critical()
|
|
|
|
|
|
pthread_t CachedCurrentThread()
|
|
|
{
|
|
|
- volatile thread_local static pthread_t t = GetCurrentThread();
|
|
|
+ volatile thread_local static pthread_t t = GetCurrentThread();
|
|
|
return (pthread_t)t;
|
|
|
}
|
|
|
|
|
@@ -151,4 +151,15 @@ void Synchronizer::notifyAll()
|
|
|
int Synchronizer::getNumberOfWaitingThreads() const
|
|
|
{
|
|
|
return numWaiting;
|
|
|
-}
|
|
|
+}
|
|
|
+
|
|
|
+Framework::CriticalLock::CriticalLock(Critical* critical)
|
|
|
+{
|
|
|
+ this->critical = critical;
|
|
|
+ critical->lock();
|
|
|
+}
|
|
|
+
|
|
|
+Framework::CriticalLock::~CriticalLock()
|
|
|
+{
|
|
|
+ critical->unlock();
|
|
|
+}
|