NAME

coreAppForward() -- forward a message to the main dispatch thread.


SYNOPSIS

include "appcore.h"

int coreAppForward( coreMsg_t* m )

DESCRIPTION

The coreAppForward() function marks the message to be forwarded to the main application thread. The forwarding happens when the user's message handler function unwinds. Normally, appCORE frees the input message when the user's message handler function unwinds. However, if the message is being forwarded, appCORE dispatches the message to the destination thread instead. In this way, it is not possible for two threads to access the same message simultaneously. This function can be called from any message handler to forward an input message to the main thread. The message must be an input message to the current thread. The message is not copied, thus the forward operation is a very efficient operation.


PARAMETERS

m
	Pointer to message.

RETURN VALUE

If successful, coreAppForward() returns 0. On failure it returns a value of -1 and sets errno to one of the following values:

errno ValueCondition
EINVALThe message is null.
ECANCELEDThe message is not an input message.

MULTI-THREAD SAFETY LEVEL

MT-safe.


SEE ALSO

Functions:
coreAppStart() coreAppStop() coreAppWaitOnStop() coreAppDispatch() coreAppLogZoneInit()