/*
 * $RCSfile: semaphore.h,v $
 *
 * x-kernel v3.3
 *
 * Copyright (c) 1996  Arizona Board of Regents
 *
 * $Log: semaphore.h,v $
 * Revision 1.1  1996/05/31 22:50:05  rrp
 * Initial revision
 *
 *
 */

#ifndef __semaphore_h
#define __semaphore_h

#include "thread.h"		/* in turn includes <pthread.h> 	*/

typedef struct sema_t {
  volatile unsigned int		count;
  pthread_mutex_t 		mutex;
  pthread_cond_t  		cond;
} sema_t;


int sema_init(sema_t *sp, int pshared, int value);
int sema_destroy(sema_t *sp);
int sema_wait(sema_t *sp);
int sema_post(sema_t *sp);


#endif
/* semaphore.h ends here */
