Resource Manager and Pulses

I would like to to MsgSendPulse to a resource manager which is blocked in
resmgr_block. However, I need to no the coid that the resource manager is
blocking on in order to do this. Anybody know how to figure out what this
connection ID is?

Brian Meinke a écrit :

I would like to to MsgSendPulse to a resource manager which is blocked in
resmgr_block. However, I need to no the coid that the resource manager is
blocking on in order to do this. Anybody know how to figure out what this
connection ID is?

You can do something like that:

int coid, pulse_code;
struct sigevent event;
dispatch_t *dpp;

dpp = dispatch_create(); // you may have this line somewhere

// to attach the pulse event and its the dedicated function to the
resource manager dispatch handler
if ((pulse_code = pulse_attach(dpp, MSG_FLAG_ALLOC_PULSE, 0,
your_function_to_call_on_pulse, NULL)) == -1) {
exit(errno);
}

// to attach the pulse reception to the resource manager channel and get
the connection id.
if ((coid = message_connect(dpp, MSG_FLAG_SIDE_CHANNEL)) == -1) {
exit(errno);
}

SIGEV_PULSE_INIT(&event, coid, SIGEV_PULSE_PRIO_INHERIT, pulse_code, 0);




Regards,
Alain.