F.7. para_msg_attach

Finds a message by its name.

Synopsis. 

#include <parabellym/api.h>

int para_msg_attach(int qid);

Arguments. 

qid
The identifier of the message queue to attach to. This is the value passed to a module's para_mod_body function.

Access. 

Unrestricted.

Description. 

This function attaches the current thread to a new message queue. Previously attached queue, if any, is detached from the current thread.

A module's main thread is attached to a separate message queue by default. Additional threads can be attached to it to make a multithreaded module.

Return value. 

PEC_SUCCESS
There specified queue was successfully attached to the current thread.
PEC_MSGQ_BAD_ID
There is no message queue with such id.