task
Description:
Increases the counter by one and schedules the given function to execute. Next, decreases the counter by one after the function is executed.
This is equivalent to:
waitgroup.add();
return Gpseq.task<G>(() => {
try {
G result = func();
return (owned) result;
} catch (Error err) {
throw err;
} finally {
waitgroup.done();
}
});
Parameters:
func |
a task function to execute |
Returns:
a future of the execution |