src/thread/pth/SDL_systhread.c
branchSDL-1.3
changeset 1668 4da1ee79c9af
parent 1662 782fd950bd46
     1.1 --- a/src/thread/pth/SDL_systhread.c	Mon May 29 03:53:21 2006 +0000
     1.2 +++ b/src/thread/pth/SDL_systhread.c	Mon May 29 04:04:35 2006 +0000
     1.3 @@ -41,71 +41,71 @@
     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 -    pth_exit ((void *) 0);
    1.12 +    SDL_RunThread(data);
    1.13 +    pth_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      pth_attr_t type;
    1.22  
    1.23      /* Create a new attribute */
    1.24 -    type = pth_attr_new ();
    1.25 +    type = pth_attr_new();
    1.26      if (type == NULL) {
    1.27 -        SDL_SetError ("Couldn't initialize pth attributes");
    1.28 +        SDL_SetError("Couldn't initialize pth attributes");
    1.29          return (-1);
    1.30      }
    1.31 -    pth_attr_set (type, PTH_ATTR_JOINABLE, TRUE);
    1.32 +    pth_attr_set(type, PTH_ATTR_JOINABLE, TRUE);
    1.33  
    1.34      /* Create the thread and go! */
    1.35 -    thread->handle = pth_spawn (type, RunThread, args);
    1.36 +    thread->handle = pth_spawn(type, RunThread, args);
    1.37      if (thread->handle == NULL) {
    1.38 -        SDL_SetError ("Not enough resources to create thread");
    1.39 +        SDL_SetError("Not enough resources to create thread");
    1.40          return (-1);
    1.41      }
    1.42      return (0);
    1.43  }
    1.44  
    1.45  void
    1.46 -SDL_SYS_SetupThread (void)
    1.47 +SDL_SYS_SetupThread(void)
    1.48  {
    1.49      int i;
    1.50      sigset_t mask;
    1.51      int oldstate;
    1.52  
    1.53      /* Mask asynchronous signals for this thread */
    1.54 -    sigemptyset (&mask);
    1.55 +    sigemptyset(&mask);
    1.56      for (i = 0; sig_list[i]; ++i) {
    1.57 -        sigaddset (&mask, sig_list[i]);
    1.58 +        sigaddset(&mask, sig_list[i]);
    1.59      }
    1.60 -    pth_sigmask (SIG_BLOCK, &mask, 0);
    1.61 +    pth_sigmask(SIG_BLOCK, &mask, 0);
    1.62  
    1.63      /* Allow ourselves to be asynchronously cancelled */
    1.64 -    pth_cancel_state (PTH_CANCEL_ASYNCHRONOUS, &oldstate);
    1.65 +    pth_cancel_state(PTH_CANCEL_ASYNCHRONOUS, &oldstate);
    1.66  }
    1.67  
    1.68  /* WARNING:  This may not work for systems with 64-bit pid_t */
    1.69  Uint32
    1.70 -SDL_ThreadID (void)
    1.71 +SDL_ThreadID(void)
    1.72  {
    1.73 -    return ((Uint32) pth_self ());
    1.74 +    return ((Uint32) pth_self());
    1.75  }
    1.76  
    1.77  void
    1.78 -SDL_SYS_WaitThread (SDL_Thread * thread)
    1.79 +SDL_SYS_WaitThread(SDL_Thread * thread)
    1.80  {
    1.81 -    pth_join (thread->handle, NULL);
    1.82 +    pth_join(thread->handle, NULL);
    1.83  }
    1.84  
    1.85  void
    1.86 -SDL_SYS_KillThread (SDL_Thread * thread)
    1.87 +SDL_SYS_KillThread(SDL_Thread * thread)
    1.88  {
    1.89 -    pth_cancel (thread->handle);
    1.90 -    pth_join (thread->handle, NULL);
    1.91 +    pth_cancel(thread->handle);
    1.92 +    pth_join(thread->handle, NULL);
    1.93  }
    1.94  
    1.95  /* vi: set ts=4 sw=4 expandtab: */