Skip to content
Commit c484573c authored by Alberto Miranda's avatar Alberto Miranda
Browse files

Add timeout parameter to waiting functions

Functions norns_wait() and nornsctl_wait() now accept an optional
const struct timespec *timeout (see nanosleep(2)) to allow users
to suspend the calling thread until one of the following occurs:

* A signal is delivered and the task has already completed.
* The specified time interval has already passed.

If timeout is NULL, the functions will suspend the thread for
a predefined amount of time and query the server upon waking up.

Note that since the server does not allow registering listeners at the
moment, the thread will wake only when one of the aforementioned
conditions has occurred, even if the task of interest has already finished.
parent 8fe820ad
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment