MsgPause(), MsgPause_r()
QNX SDP8.0C Library ReferenceAPIDeveloper
Pause the processing of a message
Synopsis:
#include <sys/neutrino.h>
int MsgPause( rcvid_t rcvid,
unsigned cookie );
int MsgPause_r( rcvid_t 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:
Note:
These functions are meant to handle a deadlock (EDEADLK) error.
However, this error can't occur in this QNX OS release,
so you shouldn't call these functions. If you do, they fail with an ENOSYS error.
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.
The deadlock error that message pausing is meant to handle could be caused by such things as:
- writing to a memory-mapped file from a buffer mapped in from a memory-mapped file that's managed by the same server
- reading from a memory-mapped file
The deadlock could make (for example) a thread of the client application block on the server, a thread from the server block on procnto, and a procnto thread block on the server.
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:
- ENOSYS
- This operation isn't supported.
Classification:
Safety: | |
---|---|
Cancellation point | No |
Signal handler | Yes |
Thread | Yes |
Page updated: