include/SDL_mutex.h
branchSDL-1.3
changeset 1662 782fd950bd46
parent 1358 c71e05b4dc2e
child 1668 4da1ee79c9af
     1.1 --- a/include/SDL_mutex.h	Sun May 21 17:27:13 2006 +0000
     1.2 +++ b/include/SDL_mutex.h	Sun May 28 13:04:16 2006 +0000
     1.3 @@ -23,10 +23,11 @@
     1.4  #ifndef _SDL_mutex_h
     1.5  #define _SDL_mutex_h
     1.6  
     1.7 -/* Functions to provide thread synchronization primitives
     1.8 -
     1.9 -	These are independent of the other SDL routines.
    1.10 -*/
    1.11 +/**
    1.12 + * \file SDL_mutex.h
    1.13 + *
    1.14 + * Functions to provide thread synchronization primitives
    1.15 + */
    1.16  
    1.17  #include "SDL_stdinc.h"
    1.18  #include "SDL_error.h"
    1.19 @@ -34,7 +35,9 @@
    1.20  #include "begin_code.h"
    1.21  /* Set up for C function definitions, even when using C++ */
    1.22  #ifdef __cplusplus
    1.23 +/* *INDENT-OFF* */
    1.24  extern "C" {
    1.25 +/* *INDENT-ON* */
    1.26  #endif
    1.27  
    1.28  /* Synchronization functions which can time out return this value
    1.29 @@ -55,21 +58,21 @@
    1.30  typedef struct SDL_mutex SDL_mutex;
    1.31  
    1.32  /* Create a mutex, initialized unlocked */
    1.33 -extern DECLSPEC SDL_mutex * SDLCALL SDL_CreateMutex(void);
    1.34 +extern DECLSPEC SDL_mutex *SDLCALL SDL_CreateMutex (void);
    1.35  
    1.36  /* Lock the mutex  (Returns 0, or -1 on error) */
    1.37  #define SDL_LockMutex(m)	SDL_mutexP(m)
    1.38 -extern DECLSPEC int SDLCALL SDL_mutexP(SDL_mutex *mutex);
    1.39 +extern DECLSPEC int SDLCALL SDL_mutexP (SDL_mutex * mutex);
    1.40  
    1.41  /* Unlock the mutex  (Returns 0, or -1 on error)
    1.42     It is an error to unlock a mutex that has not been locked by
    1.43     the current thread, and doing so results in undefined behavior.
    1.44   */
    1.45  #define SDL_UnlockMutex(m)	SDL_mutexV(m)
    1.46 -extern DECLSPEC int SDLCALL SDL_mutexV(SDL_mutex *mutex);
    1.47 +extern DECLSPEC int SDLCALL SDL_mutexV (SDL_mutex * mutex);
    1.48  
    1.49  /* Destroy a mutex */
    1.50 -extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex *mutex);
    1.51 +extern DECLSPEC void SDLCALL SDL_DestroyMutex (SDL_mutex * mutex);
    1.52  
    1.53  
    1.54  /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
    1.55 @@ -81,21 +84,21 @@
    1.56  typedef struct SDL_semaphore SDL_sem;
    1.57  
    1.58  /* Create a semaphore, initialized with value, returns NULL on failure. */
    1.59 -extern DECLSPEC SDL_sem * SDLCALL SDL_CreateSemaphore(Uint32 initial_value);
    1.60 +extern DECLSPEC SDL_sem *SDLCALL SDL_CreateSemaphore (Uint32 initial_value);
    1.61  
    1.62  /* Destroy a semaphore */
    1.63 -extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem *sem);
    1.64 +extern DECLSPEC void SDLCALL SDL_DestroySemaphore (SDL_sem * sem);
    1.65  
    1.66  /* This function suspends the calling thread until the semaphore pointed 
    1.67   * to by sem has a positive count. It then atomically decreases the semaphore
    1.68   * count.
    1.69   */
    1.70 -extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem *sem);
    1.71 +extern DECLSPEC int SDLCALL SDL_SemWait (SDL_sem * sem);
    1.72  
    1.73  /* Non-blocking variant of SDL_SemWait(), returns 0 if the wait succeeds,
    1.74     SDL_MUTEX_TIMEDOUT if the wait would block, and -1 on error.
    1.75  */
    1.76 -extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem *sem);
    1.77 +extern DECLSPEC int SDLCALL SDL_SemTryWait (SDL_sem * sem);
    1.78  
    1.79  /* Variant of SDL_SemWait() with a timeout in milliseconds, returns 0 if
    1.80     the wait succeeds, SDL_MUTEX_TIMEDOUT if the wait does not succeed in
    1.81 @@ -103,15 +106,15 @@
    1.82     On some platforms this function is implemented by looping with a delay
    1.83     of 1 ms, and so should be avoided if possible.
    1.84  */
    1.85 -extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 ms);
    1.86 +extern DECLSPEC int SDLCALL SDL_SemWaitTimeout (SDL_sem * sem, Uint32 ms);
    1.87  
    1.88  /* Atomically increases the semaphore's count (not blocking), returns 0,
    1.89     or -1 on error.
    1.90   */
    1.91 -extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem *sem);
    1.92 +extern DECLSPEC int SDLCALL SDL_SemPost (SDL_sem * sem);
    1.93  
    1.94  /* Returns the current count of the semaphore */
    1.95 -extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem *sem);
    1.96 +extern DECLSPEC Uint32 SDLCALL SDL_SemValue (SDL_sem * sem);
    1.97  
    1.98  
    1.99  /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
   1.100 @@ -123,27 +126,27 @@
   1.101  typedef struct SDL_cond SDL_cond;
   1.102  
   1.103  /* Create a condition variable */
   1.104 -extern DECLSPEC SDL_cond * SDLCALL SDL_CreateCond(void);
   1.105 +extern DECLSPEC SDL_cond *SDLCALL SDL_CreateCond (void);
   1.106  
   1.107  /* Destroy a condition variable */
   1.108 -extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond *cond);
   1.109 +extern DECLSPEC void SDLCALL SDL_DestroyCond (SDL_cond * cond);
   1.110  
   1.111  /* Restart one of the threads that are waiting on the condition variable,
   1.112     returns 0 or -1 on error.
   1.113   */
   1.114 -extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond *cond);
   1.115 +extern DECLSPEC int SDLCALL SDL_CondSignal (SDL_cond * cond);
   1.116  
   1.117  /* Restart all threads that are waiting on the condition variable,
   1.118     returns 0 or -1 on error.
   1.119   */
   1.120 -extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond *cond);
   1.121 +extern DECLSPEC int SDLCALL SDL_CondBroadcast (SDL_cond * cond);
   1.122  
   1.123  /* Wait on the condition variable, unlocking the provided mutex.
   1.124     The mutex must be locked before entering this function!
   1.125     The mutex is re-locked once the condition variable is signaled.
   1.126     Returns 0 when it is signaled, or -1 on error.
   1.127   */
   1.128 -extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond *cond, SDL_mutex *mut);
   1.129 +extern DECLSPEC int SDLCALL SDL_CondWait (SDL_cond * cond, SDL_mutex * mut);
   1.130  
   1.131  /* Waits for at most 'ms' milliseconds, and returns 0 if the condition
   1.132     variable is signaled, SDL_MUTEX_TIMEDOUT if the condition is not
   1.133 @@ -151,12 +154,18 @@
   1.134     On some platforms this function is implemented by looping with a delay
   1.135     of 1 ms, and so should be avoided if possible.
   1.136  */
   1.137 -extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms);
   1.138 +extern DECLSPEC int SDLCALL SDL_CondWaitTimeout (SDL_cond * cond,
   1.139 +                                                 SDL_mutex * mutex,
   1.140 +                                                 Uint32 ms);
   1.141  
   1.142  /* Ends C function definitions when using C++ */
   1.143  #ifdef __cplusplus
   1.144 +/* *INDENT-OFF* */
   1.145  }
   1.146 +/* *INDENT-ON* */
   1.147  #endif
   1.148  #include "close_code.h"
   1.149  
   1.150  #endif /* _SDL_mutex_h */
   1.151 +
   1.152 +/* vi: set ts=4 sw=4 expandtab: */