resmgr_detach problems

In an effort to find a quick and dirty way to force an error to any
users of my resource manager to effect a reset-on-the-fly, I tried doing
a resmgr_detach(), followed by a resmgr_attach(). The idea was to rip
the name out of the namespace, causing any current users to get an
error, then stuff the name right back into namespace for new users.
This seems to work fine on 6.3, but the resmrg_attach() gets EINVAL on
6.2. Then, while thrashing around trying to figure out what was going
on, I discovered that if I do an extra detach/attach immediately after
the original resmgr_attach(), it works OK even on 6.2! Anybody got any
idea what’s going on here, or got any ideas for a better way to drop all
current users (hopefully short of watching the OCB’s)?

Murf

I think I see the problem: it is not a good idea to set the nparts_max
field of the resmgr_attr_t parameter to zero and rely on resmgr_attach()
to “bump the value to the minimum usable by the library itself”! On the
first call to the 6.2 version of resmgr_attach(), an internal value is
calculated based on the value of nparts_max passed in, not on the bumped
value; on any following calls to resgmr_attach(), a new value is
calculated based on the bumped value. On any of these following calls,
if dispatch_context_alloc() has NOT been called, the internal value is
set to the new (correct) value, but if dispatch_context_alloc HAS been
called, resmgr_attach() thinks you’ve changed the size of the dispatch
context after already allocating one, and returns EINVAL.

Once again, cvs.qnx.com comes to the rescue! And once again I’m
reminded how wonderful it would be if cvs.qnx.com would be kept up to
data.

Murf

John Murphy wrote:

In an effort to find a quick and dirty way to force an error to any
users of my resource manager to effect a reset-on-the-fly, I tried doing
a resmgr_detach(), followed by a resmgr_attach(). The idea was to rip
the name out of the namespace, causing any current users to get an
error, then stuff the name right back into namespace for new users.
This seems to work fine on 6.3, but the resmrg_attach() gets EINVAL on
6.2. Then, while thrashing around trying to figure out what was going
on, I discovered that if I do an extra detach/attach immediately after
the original resmgr_attach(), it works OK even on 6.2! Anybody got any
idea what’s going on here, or got any ideas for a better way to drop all
current users (hopefully short of watching the OCB’s)?

Murf