Skip to content
Snippets Groups Projects
Commit 35f88ac6 authored by sapier's avatar sapier
Browse files

Fix win32 jthread implementation

parent 22dbbf0a
Branches
Tags
No related merge requests found
......@@ -27,7 +27,7 @@ JSemaphore::JSemaphore() {
}
JSemaphore::~JSemaphore() {
CloseHandle(&m_hSemaphore);
CloseHandle(m_hSemaphore);
}
JSemaphore::JSemaphore(int initval) {
......
......@@ -46,14 +46,21 @@ JThread::~JThread()
void JThread::Stop() {
runningmutex.Lock();
requeststop = false;
requeststop = true;
runningmutex.Unlock();
}
void JThread::Wait() {
int WaitForSingleObject_retval = WaitForSingleObject(threadhandle, INFINITE);
assert(WaitForSingleObject_retval == 0);
UNUSED(WaitForSingleObject_retval);
runningmutex.Lock();
if (running)
{
runningmutex.Unlock();
WaitForSingleObject(threadhandle, INFINITE);
}
else
{
runningmutex.Unlock();
}
}
int JThread::Start()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment