test/testlock.c
changeset 3578 0d1b16ee0bca
parent 2779 4436464c4f51
child 5535 96594ac5fd1a
     1.1 --- a/test/testlock.c	Wed Dec 16 03:02:31 2009 +0000
     1.2 +++ b/test/testlock.c	Wed Dec 16 04:48:11 2009 +0000
     1.3 @@ -11,7 +11,7 @@
     1.4  #include "SDL_thread.h"
     1.5  
     1.6  static SDL_mutex *mutex = NULL;
     1.7 -static Uint32 mainthread;
     1.8 +static SDL_threadID mainthread;
     1.9  static SDL_Thread *threads[6];
    1.10  static volatile int doterminate = 0;
    1.11  
    1.12 @@ -28,7 +28,7 @@
    1.13  void
    1.14  printid(void)
    1.15  {
    1.16 -    printf("Process %u:  exiting\n", SDL_ThreadID());
    1.17 +    printf("Process %lu:  exiting\n", SDL_ThreadID());
    1.18  }
    1.19  
    1.20  void
    1.21 @@ -41,9 +41,9 @@
    1.22  void
    1.23  closemutex(int sig)
    1.24  {
    1.25 -    Uint32 id = SDL_ThreadID();
    1.26 +    SDL_threadID id = SDL_ThreadID();
    1.27      int i;
    1.28 -    printf("Process %u:  Cleaning up...\n", id == mainthread ? 0 : id);
    1.29 +    printf("Process %lu:  Cleaning up...\n", id == mainthread ? 0 : id);
    1.30      doterminate = 1;
    1.31      for (i = 0; i < 6; ++i)
    1.32          SDL_WaitThread(threads[i], NULL);
    1.33 @@ -57,14 +57,14 @@
    1.34      if (SDL_ThreadID() == mainthread)
    1.35          signal(SIGTERM, closemutex);
    1.36      while (!doterminate) {
    1.37 -        printf("Process %u ready to work\n", SDL_ThreadID());
    1.38 +        printf("Process %lu ready to work\n", SDL_ThreadID());
    1.39          if (SDL_mutexP(mutex) < 0) {
    1.40              fprintf(stderr, "Couldn't lock mutex: %s", SDL_GetError());
    1.41              exit(1);
    1.42          }
    1.43 -        printf("Process %u, working!\n", SDL_ThreadID());
    1.44 +        printf("Process %lu, working!\n", SDL_ThreadID());
    1.45          SDL_Delay(1 * 1000);
    1.46 -        printf("Process %u, done!\n", SDL_ThreadID());
    1.47 +        printf("Process %lu, done!\n", SDL_ThreadID());
    1.48          if (SDL_mutexV(mutex) < 0) {
    1.49              fprintf(stderr, "Couldn't unlock mutex: %s", SDL_GetError());
    1.50              exit(1);
    1.51 @@ -73,7 +73,7 @@
    1.52          SDL_Delay(10);
    1.53      }
    1.54      if (SDL_ThreadID() == mainthread && doterminate) {
    1.55 -        printf("Process %u:  raising SIGTERM\n", SDL_ThreadID());
    1.56 +        printf("Process %lu:  raising SIGTERM\n", SDL_ThreadID());
    1.57          raise(SIGTERM);
    1.58      }
    1.59      return (0);
    1.60 @@ -98,7 +98,7 @@
    1.61      }
    1.62  
    1.63      mainthread = SDL_ThreadID();
    1.64 -    printf("Main thread: %u\n", mainthread);
    1.65 +    printf("Main thread: %lu\n", mainthread);
    1.66      atexit(printid);
    1.67      for (i = 0; i < maxproc; ++i) {
    1.68          if ((threads[i] = SDL_CreateThread(Run, NULL)) == NULL)