home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue2 / SDL.ARC / !unixlib / source / clib / bits / h / libc-lock < prev    next >
Encoding:
Text File  |  2004-09-05  |  783 b   |  34 lines

  1. /****************************************************************************
  2.  *
  3.  * $Source: /usr/local/cvsroot/gccsdk/unixlib/source/clib/bits/libc-lock.h,v $
  4.  * $Date: 2003/04/28 21:04:35 $
  5.  * $Revision: 1.1 $
  6.  * $State: Exp $
  7.  * $Author: alex $
  8.  *
  9.  ***************************************************************************/
  10.  
  11. #ifndef _BITS_LIBC_LOCK_H
  12. #define _BITS_LIBC_LOCK_H 1
  13.  
  14. #include <pthread.h>
  15.  
  16.  
  17. #if __FEATURE_PTHREADS
  18.  
  19. #define __libc_lock_define_initialized(class, name) \
  20. class pthread_mutex_t name = PTHREAD_MUTEX_INITIALIZER;
  21. #define __libc_lock_lock(x) pthread_mutex_lock(&x)
  22. #define __libc_lock_unlock(x) pthread_mutex_unlock(&x)
  23.  
  24. #else
  25.  
  26. #define __libc_lock_define_initialized(class, name)
  27. #define __libc_lock_lock(x)
  28. #define __libc_lock_unlock(x)
  29.  
  30. #endif
  31.  
  32.  
  33. #endif
  34.