Waits until an incoming message is available.
Synopsis.
#include <parabellym/api.h> int para_msg_receive(para_msgi_t *info);
Arguments.
Access.
Unrestricted.
Description.
Call this functon to wait for new messages and receive them. The calling thread will block until a message or a signal is received.
A typical module's main thread spends the most of its time waiting in this call, which looks like this:
para_msgi_t info;
while (true) {
switch (para_msg_receive(&info)) {
case PEC_SUCCESS:
// process the message...
break;
case PEC_MOD_SIGNAL:
if (info.sig == PSIG_UNLOAD)
return;
// do additional work...
break;
}
};Return value.