src/thread/pthread/SDL_systhread.c
branchSDL-1.3
changeset 1668 4da1ee79c9af
parent 1662 782fd950bd46
     1.1 --- a/src/thread/pthread/SDL_systhread.c	Mon May 29 03:53:21 2006 +0000
     1.2 +++ b/src/thread/pthread/SDL_systhread.c	Mon May 29 04:04:35 2006 +0000
     1.3 @@ -43,34 +43,34 @@
     1.4  
     1.5  
     1.6  static void *
     1.7 -RunThread (void *data)
     1.8 +RunThread(void *data)
     1.9  {
    1.10 -    SDL_RunThread (data);
    1.11 -    pthread_exit ((void *) 0);
    1.12 +    SDL_RunThread(data);
    1.13 +    pthread_exit((void *) 0);
    1.14      return ((void *) 0);        /* Prevent compiler warning */
    1.15  }
    1.16  
    1.17  int
    1.18 -SDL_SYS_CreateThread (SDL_Thread * thread, void *args)
    1.19 +SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
    1.20  {
    1.21      pthread_attr_t type;
    1.22  
    1.23      /* Set the thread attributes */
    1.24 -    if (pthread_attr_init (&type) != 0) {
    1.25 -        SDL_SetError ("Couldn't initialize pthread attributes");
    1.26 +    if (pthread_attr_init(&type) != 0) {
    1.27 +        SDL_SetError("Couldn't initialize pthread attributes");
    1.28          return (-1);
    1.29      }
    1.30 -    pthread_attr_setdetachstate (&type, PTHREAD_CREATE_JOINABLE);
    1.31 +    pthread_attr_setdetachstate(&type, PTHREAD_CREATE_JOINABLE);
    1.32  
    1.33      /* Create the thread and go! */
    1.34 -    if (pthread_create (&thread->handle, &type, RunThread, args) != 0) {
    1.35 -        SDL_SetError ("Not enough resources to create thread");
    1.36 +    if (pthread_create(&thread->handle, &type, RunThread, args) != 0) {
    1.37 +        SDL_SetError("Not enough resources to create thread");
    1.38          return (-1);
    1.39      }
    1.40  #ifdef __RISCOS__
    1.41      if (riscos_using_threads == 0) {
    1.42          riscos_using_threads = 1;
    1.43 -        riscos_main_thread = SDL_ThreadID ();
    1.44 +        riscos_main_thread = SDL_ThreadID();
    1.45      }
    1.46  #endif
    1.47  
    1.48 @@ -78,50 +78,50 @@
    1.49  }
    1.50  
    1.51  void
    1.52 -SDL_SYS_SetupThread (void)
    1.53 +SDL_SYS_SetupThread(void)
    1.54  {
    1.55      int i;
    1.56      sigset_t mask;
    1.57  
    1.58      /* Mask asynchronous signals for this thread */
    1.59 -    sigemptyset (&mask);
    1.60 +    sigemptyset(&mask);
    1.61      for (i = 0; sig_list[i]; ++i) {
    1.62 -        sigaddset (&mask, sig_list[i]);
    1.63 +        sigaddset(&mask, sig_list[i]);
    1.64      }
    1.65 -    pthread_sigmask (SIG_BLOCK, &mask, 0);
    1.66 +    pthread_sigmask(SIG_BLOCK, &mask, 0);
    1.67  
    1.68  #ifdef PTHREAD_CANCEL_ASYNCHRONOUS
    1.69      /* Allow ourselves to be asynchronously cancelled */
    1.70      {
    1.71          int oldstate;
    1.72 -        pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, &oldstate);
    1.73 +        pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldstate);
    1.74      }
    1.75  #endif
    1.76  }
    1.77  
    1.78  /* WARNING:  This may not work for systems with 64-bit pid_t */
    1.79  Uint32
    1.80 -SDL_ThreadID (void)
    1.81 +SDL_ThreadID(void)
    1.82  {
    1.83 -    return ((Uint32) pthread_self ());
    1.84 +    return ((Uint32) pthread_self());
    1.85  }
    1.86  
    1.87  void
    1.88 -SDL_SYS_WaitThread (SDL_Thread * thread)
    1.89 +SDL_SYS_WaitThread(SDL_Thread * thread)
    1.90  {
    1.91 -    pthread_join (thread->handle, 0);
    1.92 +    pthread_join(thread->handle, 0);
    1.93  }
    1.94  
    1.95  void
    1.96 -SDL_SYS_KillThread (SDL_Thread * thread)
    1.97 +SDL_SYS_KillThread(SDL_Thread * thread)
    1.98  {
    1.99  #ifdef PTHREAD_CANCEL_ASYNCHRONOUS
   1.100 -    pthread_cancel (thread->handle);
   1.101 +    pthread_cancel(thread->handle);
   1.102  #else
   1.103  #ifdef __FREEBSD__
   1.104  #warning For some reason, this doesnt actually kill a thread - FreeBSD 3.2
   1.105  #endif
   1.106 -    pthread_kill (thread->handle, SIGKILL);
   1.107 +    pthread_kill(thread->handle, SIGKILL);
   1.108  #endif
   1.109  }
   1.110