Skip to content

Instantly share code, notes, and snippets.

@sbarratt
Last active July 15, 2016 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbarratt/005ee874a9ce9454112ee80b5bfe40a0 to your computer and use it in GitHub Desktop.
Save sbarratt/005ee874a9ce9454112ee80b5bfe40a0 to your computer and use it in GitHub Desktop.
Windows multithreading in c++
//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