[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
[an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]![]() |
![]() |
![]() |
|||||||||||||||||||||||||
|
|||||||||||||||||||||||||||
![]() |
![]() |
![]() |
Under Windows kan jeg skrive void MyClass::start_thread() { if (hThread!=NULL) { stop_thread=true; WaitForSingleObject(hThread,INFINITE); } stop_thread=false; hThread=::CreateThread(0,0,ThreadProc,LPVOID(this),0,&id); } ,hvor hThread er sat lig NULL til at starte med i constructoren. Men hvad skriver jeg under Linux? Jeg forstår at jeg skal bruge int pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)(void*), void *arg); men hvordan kan jeg initialisere en "pthread_t" variable? Er følgende muligt?: pthread_t t=NULL
![]() |
![]() |
![]() |
||||||||||||
|
||||||||||||||
![]() | ||||||||||||||
|
||||||||||||||
![]() |
![]() |
![]() |