tar: use utime() to restore timestamps
[minix.git] / include / ddekit / lock.h
blob2a128042fcf36677eb39d998897e8870139dd058
1 #ifndef _DDEKIT_LOCK_H
2 #define _DDEKIT_LOCK_H
4 #include <ddekit/ddekit.h>
6 struct ddekit_lock;
7 typedef struct ddekit_lock *ddekit_lock_t;
9 /* Initialize a DDEKit unlocked lock. */
10 #define ddekit_lock_init ddekit_lock_init_unlocked
12 /* Initialize a DDEKit unlocked lock. */
13 void ddekit_lock_init_unlocked(ddekit_lock_t *mtx);
15 /* Initialize a DDEKit locked lock. */
16 void ddekit_lock_init_locked(ddekit_lock_t *mtx);
18 /* Uninitialize a DDEKit lock. */
19 void ddekit_lock_deinit(ddekit_lock_t *mtx);
21 /* Acquire a lock. */
22 void ddekit_lock_lock(ddekit_lock_t *mtx);
24 /* Acquire a lock, non-blocking. */
25 int ddekit_lock_try_lock(ddekit_lock_t *mtx);
27 /* Unlock function. */
28 void ddekit_lock_unlock(ddekit_lock_t *mtx);
30 /* Get lock owner. */
31 int ddekit_lock_owner(ddekit_lock_t *mtx);
33 #endif