test/testlock.c
changeset 5969 3a041d215edc
parent 5535 96594ac5fd1a
child 6977 b73d51026c68
equal deleted inserted replaced
5968:b229328c7ad4 5969:3a041d215edc
   110 
   110 
   111     mainthread = SDL_ThreadID();
   111     mainthread = SDL_ThreadID();
   112     printf("Main thread: %lu\n", mainthread);
   112     printf("Main thread: %lu\n", mainthread);
   113     atexit(printid);
   113     atexit(printid);
   114     for (i = 0; i < maxproc; ++i) {
   114     for (i = 0; i < maxproc; ++i) {
   115         if ((threads[i] = SDL_CreateThread(Run, NULL)) == NULL)
   115         char name[64];
       
   116         SDL_snprintf(name, sizeof (name), "Worker%d", i);
       
   117         if ((threads[i] = SDL_CreateThread(Run, name, NULL)) == NULL)
   116             fprintf(stderr, "Couldn't create thread!\n");
   118             fprintf(stderr, "Couldn't create thread!\n");
   117     }
   119     }
   118     signal(SIGINT, terminate);
   120     signal(SIGINT, terminate);
   119     Run(NULL);
   121     Run(NULL);
   120 
   122