/* semaphore.h,v 1.9 2001/04/21 22:43:09 coryan Exp

 * ============================================================================
 *
 * = LIBRARY
 *    pace
 *
 * = FILENAME
 *    pace/win32/semaphore.h
 *
 * = AUTHOR
 *    Luther Baker
 *
 * ============================================================================ */

#ifndef PACE_SEMAPHORE_H_WIN32
#define PACE_SEMAPHORE_H_WIN32

#include <windows.h>

#if defined (PACE_HAS_CPLUSPLUS)
extern "C" {
#endif /* PACE_HAS_CPLUSPLUS */

#ifndef PACE_SEM_T
#define PACE_SEM_T
  typedef HANDLE pace_sem_t;
#endif /* PACE_SEM_T */

#if (PACE_HAS_POSIX_NONUOF_FUNCS)
  int sem_close (pace_sem_t * sem);
#endif /* PACE_HAS_POSIX_NONUOF_FUNCS */

#if (PACE_HAS_POSIX_NONUOF_FUNCS)
  int sem_destroy (pace_sem_t * sem);
#endif /* PACE_HAS_POSIX_NONUOF_FUNCS */

#if (PACE_HAS_POSIX_NONUOF_FUNCS)
  int sem_init (pace_sem_t * sem, int pshared, unsigned int value);
#endif /* PACE_HAS_POSIX_NONUOF_FUNCS */

#if (PACE_HAS_POSIX_NONUOF_FUNCS)
  PACE_INLINE pace_sem_t * sem_open (const char * name, int oflag, ...);
#endif /* PACE_HAS_POSIX_NONUOF_FUNCS */

#if (PACE_HAS_POSIX_NONUOF_FUNCS)
  int sem_post (pace_sem_t * sem);
#endif /* PACE_HAS_POSIX_NONUOF_FUNCS */

#if (PACE_HAS_POSIX_NONUOF_FUNCS)
  int sem_trywait (pace_sem_t * sem);
#endif /* PACE_HAS_POSIX_NONUOF_FUNCS */

#if (PACE_HAS_POSIX_NONUOF_FUNCS)
  int sem_wait (pace_sem_t * sem);
#endif /* PACE_HAS_POSIX_NONUOF_FUNCS */

#if defined (PACE_HAS_CPLUSPLUS)
}
#endif /* PACE_HAS_CPLUSPLUS */

#endif /* PACE_SEMAPHORE_H_WIN32 */
