Chapter Contents |
Previous |
Next |
coexit |
SYNOPSIS | |
DESCRIPTION | |
RETURN VALUE | |
EXAMPLE | |
RELATED FUNCTIONS |
SYNOPSIS |
#include <coproc.h> void coexit(void *val);
DESCRIPTION |
coexit
terminates execution of the current coprocess and returns
a pointer value to its cocaller. The call to
cocall
that called the terminating coprocess is resumed, and it returns
the value specified by
val
.
If
coexit
is called by the main coprocess, it is treated as a call If
coexit
is called by the main
coprocess, it is treated as a call to exit. Specifically,
coexit(val)
is treated as
exit(val? *(int *) val: 0)
.
coexit
is implemented as a
longjmp
to a location within the library coprocess initialization routine. This means
that the
blkjmp
function
can be used within a coprocess to intercept calls to
coexit
.
If program execution is terminated by a call to the
exit
function If program execution
is terminated by a call to the
exit
function while there are still coprocesses active, each active
coprocess is terminated by an implicit call to
coexit
. These calls also can be intercepted by
blkjmp
; however, note that in this context any
use of
coreturn
fails,
because no calling coprocess is defined.
RETURN VALUE |
Control does not return from
coexit
.
EXAMPLE |
See the example for
coreturn
.
RELATED FUNCTIONS |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.