Closing and Redeeming an IOU
In this example, the RWThreadIOUFunction class closes the IOU when the sync_service() function returns a result back to the runnable.
Threads attempting to redeem an IOU that has not been closed block until another thread writes a result or exception to that IOU object. If an IOU is closed with an exception, any attempt to redeem the IOU produces that exception.
For more information, see
Closing an IOU and
Redeeming an IOU.