| [ Web Proxy ] |
| Viewing: https://raw.githubusercontent.com/aimer1027/linux_test/master/testThread.cpp | [Back] [Original] |
#include
#include
#include
pthread_t threadList[10] ;
void * myID (void *)
{
printf ("thread id : %u \n" , (unsigned int)pthread_self() ) ;
}
int main ( int c , char ** v )
{
//pthread_t threadList[10] ;
for ( int i = 0 ; i < 10 ;i++ )
{
pthread_create( &threadList[i] , NULL , myID , NULL ) ;
pthread_join ( threadList[i] , NULL ) ;
}
return 0 ;
}
| Web Proxy Viewer | New URL | Original Page |