![]() |
Home | Libraries | People | FAQ | More |
Request the executor to invoke the given function object.
template< typename Function> constraint_t< traits::execute_member< const Executor &, Function >::is_valid, void > execute( Function && f) const;
If there is a trampoline with this executor's identity installed on the current thread, and it has sufficient capacity, the function object is queued on it and invoked as the trampoline is drained. If the trampoline has no more capacity, or has a different identity, the function object is wrapped and submitted to the target executor, so that a trampoline is installed within the target executor's context.
If there is no trampoline, the function object wrapper is submitted using
the blocking.never property when this executor's blocking
property is blocking.never, and is otherwise handed to the
target executor as it is, which establishes the trampoline from within
the target's own execution.
The trampoline's inline_exception_handling
property governs an exception from every function object submitted through
this function, including one that the trampoline chooses to run immediately
under max_inline_depth.
Whether a submitted function is queued or run immediately is an optimisation
that the caller cannot observe, and it does not alter the handling of an
exception that function throws.
The function object to be called. The function signature must be:
void function();