OpenMaple/C/MapleTaskReturn - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : OpenMaple/C/MapleTaskReturn

MapleTaskReturn

Return a value from within the Task Programming Model

 

Calling Sequence

Parameters

Description

Calling Sequence

MapleTaskReturn( kv, void *value, void (M_DECL *MarkFunction)( void * ) )

Parameters

kv

-

kernel handle of type MKernelVector

value

-

a pointer to the output struct for the root task

MarkFunction

-

the function called when a garbage collection occurs

Description

• 

The MapleTaskReturn function allows a task to stop the current invocation of the Task Programming Model and to cause a value to be returned to MapleStartRootTask.

• 

Calling MapleTaskReturn does not abort currently executing tasks, however new tasks from the current invocation of the Task Model will not be started.

• 

MapleTaskReturn returns $1$ for the first call in the current invocation of the Task Model and $0$ for any subsequent calls.  The value passed into MapleTaskReturn when it returns $1$ is the value that will be returned.

• 

The MarkFunction parameter is used to mark value if a garbage collection occurs before the MapleStartRootTask returns.  If value does not need to be marked, $NULL$ can be passed for MarkFunction.

• 

MapleTaskReturn is the external call equivalent of Threads:-Task:-Return.

See Also

CustomWrapper

define_external

OpenMaple

OpenMaple/C/API

OpenMaple/C/Examples

OpenMaple/C/MapleCreateContinuationTask

OpenMaple/C/MapleStartChildTask

OpenMaple/C/MapleStartRootTask