WINPR_API HANDLE CreateRemoteThread(HANDLE hProcess, LPSECURITY_ATTRIBUTES lpThreadAttributes, SIZE_T dwStackSize,
LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId);
-WINPR_API VOID ExitThread(DWORD dwExitCode);
+WINPR_API DECLSPEC_NORETURN VOID ExitThread(DWORD dwExitCode);
WINPR_API BOOL GetExitCodeThread(HANDLE hThread, LPDWORD lpExitCode);
WINPR_API HANDLE _GetCurrentThread(void);
backtrace(thread->exit_stack, 20);
#endif
ListDictionary_Unlock(thread_list);
+ set_event(thread);
+
+ if (thread->detached || !thread->started)
+ cleanup_handle(thread);
+
+ pthread_exit(thread->dwExitCode);
}
}
#if defined(HAVE_EXECINFO_H)
backtrace(stack, 20);
#endif
- fprintf(stderr, "---------------- %s ----------------------\n", __FUNCTION);
+ fprintf(stderr, "---------------- %s ----------------------\n", __FUNCTION);
fprintf(stderr, "---------------- Called from ----------------------------\n");
#if defined(HAVE_EXECINFO_H)
backtrace_symbols_fd(stack, 20, STDERR_FILENO);