resmgr_pause_queue()

Updated: April 19, 2023

Request to pause a message

Synopsis:

#include <sys/iofunc.h>
#include <sys/resmgr.h>
#include <sys/dispatch.h>

int resmgr_pause_queue(
      resmgr_context_t *const ctp, 
      const void *const private_data,
      const size_t extra_size );

Arguments:

ctp
A pointer to a resmgr_context_t structure that the resource manager library uses to pass context information between functions.
private_data
Private data to pass to the callback that will be specified by resmgr_pause_resume(). This can be a small amount of data stored in a void*, or a pointer to memory that stores the private data. For details, see below.
extra_size
The size, in bytes, of any buffer pointed to by private_data. This many extra bytes get allocated in addition to the bytes needed for a queue entry.

Library:

libc

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

Description:

The resmgr_pause_queue() function adds a request to pause the message indicated by ctp->rcvid to a queue of paused messages. This function is used by resource managers for message pausing in deadlock (EDEADLK) situations. For an explanation of how this type of error can occur, see MsgPause(), MsgPause_r().

This function and resmgr_pause_resume() work as a pair. Your server must call this latter function after receiving notification from the kernel through a _PULSE_CODE_RESTART pulse that the deadlock has been avoided; usually this is in your resource manager's unpause handler.

If extra_size is 0, then private_data is passed to the callback as is. If extra_size is not 0, then this amount of space is allocated for the callback data buffer and the contents of private_data are copied into this buffer. The caller is not responsible for freeing this memory.

Returns:

_RESMGR_NOREPLY
The message pause request was successfully added to the queue.
EDEADLK
The message pause request couldn't be added to the queue. This could occur because of any error that can affect MsgPause().

Classification:

QNX Neutrino

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