Implementing A "Future" (Cont.) Finally, the function used to set the value of the future: /* set the value of the given future, */ /* notifying any waiting thread. */ /* returns 1 on success, 0 otherwise. */ int int_future_set_value(struct int_future* f, int value) { int rc = -1; /* assume failure. */ if (!f) { errno = EINVAL; goto int_future_set_value_ret; }