| << Prev | appCORE Programming Guide | Next >> |
NAME
coreAppDispatch() -- send a message to the main dispatch thread.
SYNOPSIS
include "appcore.h" int coreAppDispatch( coreMsg_t* m )
DESCRIPTION
The coreAppDispatch() function sends, or dispatches, a standard appCORE message to the application's main dispatch thread. This function can be called from anywhere in application code to send a message to the main thread. The message must be created via a call to the function coreMsgCreate() or coreMsgDup(). Thread input messages can not be dispatched, they are forwarded via the function coreMsgForward().
If the function fails for any reason, the caller should free the input msg via a call to coreMsgFree() to avoid a resource leak.
PARAMETERS
m Pointer to message.
RETURN VALUE
If successful, coreAppDispatch() returns 0. On failure it returns a value of -1 and sets errno to one of the following values:
| errno Value | Condition |
| EINVAL | Input message is null, or application is not running. |
| ECANCELED | Trying to dispatch an input message. |
| EIDRM | The application is not running. |
| ENOMEM | Insufficient memory for operation. |
MULTI-THREAD SAFETY LEVEL
MT-safe.
| << Prev | appCORE Programming Guide | Next >> |