Implementing A "Future" (Cont.) The method used when waiting for a value to be set: /* wait for the value of the given future to be set. */ /* returns '0' on success, '-1' on error. */ /* if success, stores the value in '*value'. */ /* on failure, 'errno' is set to 'EAGAIN' if there */ /* was a timeout. */ int int_future_wait_for_value(struct int_future* f, int* value) { int rc = -1; /* assume failure. */ if (!f || !value) { errno = EINVAL; goto int_future_wait_for_value_ret; }