summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/thread/thread_os2.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/thread/thread_os2.cpp b/src/thread/thread_os2.cpp
index 1145e8e41..c6c7db7df 100644
--- a/src/thread/thread_os2.cpp
+++ b/src/thread/thread_os2.cpp
@@ -94,16 +94,19 @@ private:
class ThreadMutex_OS2 : public ThreadMutex {
private:
HMTX mutex;
+ HEV event;
public:
ThreadMutex_OS2()
{
DosCreateMutexSem(NULL, &mutex, 0, FALSE);
+ DosCreateEventSem(NULL, &event, 0, FALSE);
}
/* virtual */ ~ThreadMutex_OS2()
{
DosCloseMutexSem(mutex);
+ DosCloseEventSem(event);
}
/* virtual */ void BeginCritical()
@@ -115,6 +118,18 @@ public:
{
DosReleaseMutexSem(mutex);
}
+
+ /* virtual */ void WaitForSignal()
+ {
+ this->EndCritical();
+ DosWaitEventSem(event, SEM_INDEFINITE_WAIT);
+ this->BeginCritical();
+ }
+
+ /* virtual */ void SendSignal()
+ {
+ DosPostEventSem(event);
+ }
};
/* static */ ThreadMutex *ThreadMutex::New()