future


To hold the future result of a user supplied function, use a future. When the redeem member is called, two possible actions occur. If the user function has finished and returned a value, the redeem function returns the value. If the user function is still executing, the redeem function will block until the return value can be obtained.

Library

Thread<ToolKit>

Declaration

#include <ospace/thread/future.h>

class os_future

Interface

Constructor
os_future()
Constructs a future with empty result.
Constructor
os_future( os_future_thread* future_thread )
Constructs a future with empty result and associated with future_thread .
Constructor
os_future( const os_future& future )
Constructs a copy of future .
Destructor
~os_future()
Destroys the future.
redeem
void* redeem()
Returns the value contained in future but will block if user function has not finished.
redeemed
bool redeemed() const
Returns true if the value contained in future has already been fetched.

Copyright©1994-2026 Recursion Software LLC
All Rights Reserved - For use by licensed users only.