F.6. para_mod_signal

Signalize a module.

Synopsis. 

#include <parabellym/api.h>

int para_mod_signal(int qid, int signal);

Arguments. 

qid
The identifier of the message queue, received by para_mod_body.
signal
A custom signal code. Negative values are reserved for system use (e.g., PSIG_UNLOAD).

Access. 

Unrestricted.

Description. 

This function is intended to be used inside a module to coordinate threads.

Sends a signal to the specified queue. Unlike regular messages, signals are delivered to the sender as well. Signals have a greater priority than regular messages. The para_msg_receive function first retreives signals, if any, then messages.

Return value. 

PEC_SUCCESS
The signal was sent.
PEC_MSGQ_BAD_ID
An invalid queue identifier was used.
PEC_UNAUTHORIZED
An attempt to send a restricted signal, such as PSIG_UNLOAD, was made.