Last active
July 15, 2016 11:01
-
-
Save sbarratt/005ee874a9ce9454112ee80b5bfe40a0 to your computer and use it in GitHub Desktop.
Windows multithreading in c++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//more details: http://www.bogotobogo.com/cplusplus/multithreaded2A.php | |
#include <Windows.h> | |
#include <process.h> | |
#include <stdio.h> | |
unsigned int __stdcall test_thread(void *data) { | |
printf("Thread Started"); | |
return 0; | |
} | |
int main() | |
{ | |
HANDLE myhandle = (HANDLE) _beginthreadex(NULL, 0, &test_thread, NULL, 0, 0); | |
WaitForSingleObject(myhandle, INFINITE); | |
CloseHandle(myhandle); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment