#include <synchro.h>
Public Member Functions | |
template<class PresentType> | |
target (const PresentType &refPres, Allocator tmpAlloc=Allocator()) | |
const ResultType & | result (void) const |
Private Attributes | |
counted_ptr< holder_base > | _ptrSpwn |
Classes | |
class | holder |
struct | holder_base |
rpa::target< ResultType, Allocator >::target | ( | const PresentType & | refPres, | |
Allocator | tmpAlloc = Allocator() | |||
) | [inline] |
When the target is destroyed, it calls the destructor of the spawn, which cannot leave until the thread is finished, because of the target. It is possible to specify an allocator object.
const ResultType& rpa::target< ResultType, Allocator >::result | ( | void | ) | const [inline] |
counted_ptr< holder_base > rpa::target< ResultType, Allocator >::_ptrSpwn [private] |
The counted ptr makes that even if the future is copied, the thread which is running still points on the same object.