minix/include/ddekit/semaphore.h
Ben Gras 6a73e85ad1 retire _PROTOTYPE
. only good for obsolete K&R support
	. also remove a stray ansi.h and the proto cmd
2012-03-25 16:17:10 +02:00

53 lines
1,018 B
C

#ifndef _DDEKIT_SEMAPHORE_H
#define _DDEKIT_SEMAPHORE_H
#include <ddekit/ddekit.h>
/** \defgroup DDEKit_synchronization */
struct ddekit_sem;
typedef struct ddekit_sem ddekit_sem_t;
/** Initialize DDEKit semaphore.
*
* \ingroup DDEKit_synchronization
*
* \param value initial semaphore counter
*/
ddekit_sem_t *ddekit_sem_init(int value);
/** Uninitialize semaphore.
*
* \ingroup DDEKit_synchronization
*/
void ddekit_sem_deinit(ddekit_sem_t *sem);
/** Semaphore down method. */
void ddekit_sem_down(ddekit_sem_t *sem);
/** Semaphore down method, non-blocking.
*
* \ingroup DDEKit_synchronization
*
* \return 0 success
* \return !=0 would block
*/
int ddekit_sem_down_try(ddekit_sem_t *sem);
/** Semaphore down with timeout.
*
* \ingroup DDEKit_synchronization
*
* \return 0 success
* \return !=0 would block
*/
int ddekit_sem_down_timed(ddekit_sem_t *sem, int timo);
/** Semaphore up method.
*
* \ingroup DDEKit_synchronization
*/
void ddekit_sem_up(ddekit_sem_t *sem);
#endif