···6969bool libsimple_rwlock_try_lock_write(libsimple_rwlock_t* rwlock);
7070void libsimple_rwlock_unlock_write(libsimple_rwlock_t* rwlock);
71717272+//
7373+// condvar
7474+//
7575+7676+typedef struct libsimple_condvar {
7777+ uint32_t state;
7878+} libsimple_condvar_t;
7979+8080+#define LIBSIMPLE_CONDVAR_INITIALIZER {0}
8181+8282+LIBSIMPLE_INLINE
8383+static void libsimple_condvar_init(libsimple_condvar_t* condvar) {
8484+ condvar->state = 0;
8585+};
8686+8787+// NOTE: the same lock must be used for all operations with a condvar.
8888+// the only reason we don't just store a pointer to the lock in the condvar
8989+// is so that condvars can be initialized statically.
9090+9191+void libsimple_condvar_wait(libsimple_condvar_t* condvar, libsimple_lock_t* lock);
9292+void libsimple_condvar_notify_one(libsimple_condvar_t* condvar, libsimple_lock_t* lock);
9393+void libsimple_condvar_notify_all(libsimple_condvar_t* condvar, libsimple_lock_t* lock);
9494+7295LIBSIMPLE_DECLARATIONS_END;
73967497#endif // _LIBSIMPLE_LOCK_H_