_CCALL - invoke a co-routine group.


#include <coro.h>
retval = _ccall( cptr [, value] );


is the value returned by the co-routine group.
_coptr cptr;
is a co-routine identifier as returned by "_coro". This tells which co-routine you want to invoke.
is an optional value to be passed to the invoked co-routine.


"_ccall" invokes the co-routine specified by "cptr". The co-routine will begin execution at the point at which it was last suspended (by "_ccall", "_resume", "_cret", BREAK, or a function entry). "_ccall" saves a pointer to the current co-routine (i.e. the one that invokes "_ccall") in the header of the co-routine being invoked. This lets the co-routine return with "_cret" if it wants to. This pointer to the caller (parent attribute) is also passed to any co-routines that are resumed by the callee.

If "value" is specified for a co-routine that has not been invoked previously, the first argument will be set to "value". This will override the value of the first argument specified in the call to "_coro".

See Also:

expl nsc coro

expl nsc lib _coro

expl nsc lib _cret

expl nsc lib _resume

expl nsc lib _cdel

Copyright © 1996, Thinkage Ltd.