diff options
Diffstat (limited to 'src/jthread/win32')
-rw-r--r-- | src/jthread/win32/jthread.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/jthread/win32/jthread.cpp b/src/jthread/win32/jthread.cpp index 1cf4f93a3..e56c16271 100644 --- a/src/jthread/win32/jthread.cpp +++ b/src/jthread/win32/jthread.cpp @@ -35,6 +35,7 @@ JThread::JThread() { retval = NULL; mutexinit = false; + requeststop = false; running = false; } @@ -45,7 +46,7 @@ JThread::~JThread() void JThread::Stop() { runningmutex.Lock(); - running = false; + requeststop = false; runningmutex.Unlock(); } @@ -76,6 +77,7 @@ int JThread::Start() runningmutex.Unlock(); return ERR_JTHREAD_ALREADYRUNNING; } + requeststop = false;e runningmutex.Unlock(); continuemutex.Lock(); @@ -134,6 +136,15 @@ bool JThread::IsRunning() return r; } +bool JThread::StopRequested() { + bool r; + + runningmutex.Lock(); + r = requeststop; + runningmutex.Unlock(); + return r; +} + void *JThread::GetReturnValue() { void *val; |