How to do "pthread" under windows? [closed]
I have tried:
1) POSIX Threads for Win32, myfiles1
What I did was copying the files in “lib” and “include” folders form the "Pre-built.2" directory to my project directory, and add this line to mapping.cpp
#pragma comment(lib, "pthreadVC2.lib")
2) and this tutorial, myfiles2
But I couldn't figure out how to change this part:
#if de开发者_如何学运维fined(LINUX)
pthread_t thread_print;
int iret_print;
iret_print = pthread_create( &thread_print, NULL, glRender, (void*) &globalOG);
#elif defined(WINDOWS)
HANDLE thread_id;
CreateThread(
NULL, // default security attributes
0, // use default stack size
glRender, // thread function name
NULL, // argument to thread function
0, // use default creation flags
&thread_id); // returns the thread identifier
#endif
I probably have done something wrong with the Win implementation
#elif defined(WINDOWS)
DWORD WINAPI glRender( void *ptr )
精彩评论