MsgPause(), MsgPause_r()

Pause the processing of a message

Synopsis:

#include <sys/neutrino.h>

int MsgPause( int rcvid,
              unsigned cookie );

int MsgPause_r( int rcvid,
                unsigned cookie );

Arguments:

rcvid
The receive ID that MsgReceive*() returned when you received the message.
cookie
A value for the kernel to pass back to the resource manager with the _PULSE_CODE_RESTART pulse when the situation has been resolved.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The MsgPause() and MsgPause_r() kernel calls pause a message. The thread associated with the rcvid must be reply-blocked on a channel that's owned by the calling process.

Here's an overview of how you'd use these functions:

Blocking states

None. If priority inheritance causes the priority of the calling thread to drop, other threads may run.

Returns:

The only difference between these functions is the way they indicate errors.

MsgPause()
If successful, this function returns EOK. If an error occurs, it returns -1 and sets errno.
MsgPause_r()
If successful, this function returns EOK. This function does NOT set errno, even on success. If an error occurs, it may return any value from the Errors section.

Errors:

EINVAL
The thread associated with the rcvid already has a message paused.
ENOMEM
There wasn't enough memory available.
ESRCH
The thread associated with the rcvid isn't in STATE_REPLY.

Classification:

QNX Neutrino

Safety:  
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes