4 #include <ddekit/ddekit.h>
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
);
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
);
31 int ddekit_lock_owner(ddekit_lock_t
*mtx
);