header file: pthread.h
void pthread_exit(void *value_ptr);
header file: Windows.h
void WINAPI ExitThread(__in DWORD dwExitCode);
The pthread_exit function is used to terminate a thread. The
value is returned to any successfully joining thread.
The Windows equivalent function is effectively the same as the
POSIX version. This deallocates the stack and cancels all pending
I/O.
Example of Use in Windows
#include <stdio.h>
#include <windows.h>
DWORD WINAPI newThreadFunc(LPVOIDarg)
{
printf("Hello World from the new thread\n");
return 0;
}
main()
{
printf("Hello World from the main program\n");
HANDLE hThread= CreateThread(NULL,0,newThreadFunc,NULL,0,NULL);
return 0;
}