diff options
| author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2012-02-21 23:37:19 +0000 |
|---|---|---|
| committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2012-02-22 01:49:55 +0000 |
| commit | 0d6bc97a073fc3aacd0cc4ff417edf6d5f79a25c (patch) | |
| tree | b1613ee6efb4a18961fb43ee6b660e8b94fd196e /libddekit/ddekit/semaphore.h | |
| parent | 0d540cbe80276303d9cf1012da97f44d65285288 (diff) | |
Clean up includes
To use the standard hurd Makeconf rules and permit external dde_* build
Conflicts:
dde_e100/Makefile
dde_e1000/Makefile
dde_ne2k_pci/Makefile
dde_pcnet32/Makefile
dde_rtl8139/Makefile
Diffstat (limited to 'libddekit/ddekit/semaphore.h')
| -rw-r--r-- | libddekit/ddekit/semaphore.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/libddekit/ddekit/semaphore.h b/libddekit/ddekit/semaphore.h new file mode 100644 index 00000000..c959919d --- /dev/null +++ b/libddekit/ddekit/semaphore.h @@ -0,0 +1,50 @@ +#ifndef _ddekit_semaphore_h +#define _ddekit_semaphore_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 |
