summaryrefslogtreecommitdiff
path: root/src/threadengines
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-06-24 12:53:10 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-06-24 12:53:10 +0200
commit7bb96595ee11acda44bdeda400e356d4044e072e (patch)
tree91a317793811a02ad49d124b93f169f848aa2b94 /src/threadengines
parentf8d18d82c707f4ac2de04e96fe55cdfd39374bbc (diff)
Move and rename ThreadData::FreeThread() to ThreadEngine::Stop() and document what it does
Diffstat (limited to 'src/threadengines')
-rw-r--r--src/threadengines/threadengine_pthread.cpp4
-rw-r--r--src/threadengines/threadengine_win32.cpp3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/threadengines/threadengine_pthread.cpp b/src/threadengines/threadengine_pthread.cpp
index 7900e66bc..fcb4db444 100644
--- a/src/threadengines/threadengine_pthread.cpp
+++ b/src/threadengines/threadengine_pthread.cpp
@@ -43,10 +43,10 @@ void ThreadEngine::Start(Thread* thread)
throw CoreException("Unable to create new thread: " + std::string(strerror(errno)));
}
-void ThreadData::FreeThread(Thread* thread)
+void ThreadEngine::Stop(Thread* thread)
{
thread->SetExitFlag();
- pthread_join(pthread_id, NULL);
+ pthread_join(thread->state.pthread_id, NULL);
}
#ifdef HAS_EVENTFD
diff --git a/src/threadengines/threadengine_win32.cpp b/src/threadengines/threadengine_win32.cpp
index 3376f937a..33eb707e4 100644
--- a/src/threadengines/threadengine_win32.cpp
+++ b/src/threadengines/threadengine_win32.cpp
@@ -42,9 +42,10 @@ DWORD WINAPI ThreadEngine::Entry(void* parameter)
return 0;
}
-void ThreadData::FreeThread(Thread* thread)
+void ThreadEngine::Stop(Thread* thread)
{
thread->SetExitFlag();
+ HANDLE handle = thread->state.handle;
WaitForSingleObject(handle,INFINITE);
CloseHandle(handle);
}