Merge pull request #1955 from nfedera/fix-2014-07-10-02
winpr: CloseHandle did not release the thread TCB
This commit is contained in:
commit
6b47229563
@ -139,6 +139,9 @@ BOOL CloseHandle(HANDLE hObject)
|
|||||||
WINPR_THREAD* thread;
|
WINPR_THREAD* thread;
|
||||||
|
|
||||||
thread = (WINPR_THREAD*) Object;
|
thread = (WINPR_THREAD*) Object;
|
||||||
|
if (thread->started) {
|
||||||
|
pthread_detach(thread->thread);
|
||||||
|
}
|
||||||
free(thread);
|
free(thread);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -259,6 +259,8 @@ DWORD WaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds)
|
|||||||
else
|
else
|
||||||
status = pthread_join(thread->thread, &thread_status);
|
status = pthread_join(thread->thread, &thread_status);
|
||||||
|
|
||||||
|
thread->started = FALSE;
|
||||||
|
|
||||||
if (status != 0)
|
if (status != 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "WaitForSingleObject: pthread_join failure: [%d] %s\n",
|
fprintf(stderr, "WaitForSingleObject: pthread_join failure: [%d] %s\n",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user