- * Put current thread to sleep until the time is UNTIL.
- * May sleep somehwat longer, but never shorter.
+ * Put current thread to sleep until the time is @until.
+ * Return 0 if it slept until that time.
+ * Return -1 if woken up early, by empth_wakeup().
+ */
+int empth_sleep(time_t until);
+
+/*
+ * Put current thread to sleep until SIGHUP, SIGINT or SIGTERM is received.
+ * Return the signal number.
+ */
+int empth_wait_for_signal(void);
+
+/*
+ * Create a read-write lock.
+ * @name is its name, it is used for debugging.
+ * Return the read-write lock, or NULL on error.
+ */
+empth_rwlock_t *empth_rwlock_create(char *name);
+
+/*
+ * Destroy @rwlock.
+ */
+void empth_rwlock_destroy(empth_rwlock_t *rwlock);
+
+/*
+ * Lock @rwlock for writing.
+ * A read-write lock can be locked for writing only when it is
+ * unlocked. If this is not the case, put the current thread to sleep
+ * until it is.