[ofa-general] Re: [PATCH V2 - libibverbs] Added reference count to completion event channels
Roland Dreier
rdreier at cisco.com
Mon Mar 19 14:48:24 PDT 2007
Thanks. However, it seems racy to me to use the mutex as you do here.
I think if a consumer calls ibv_create_cq() and ibv_destroy_comp_channel()
simultaneously (for the same completion channel obviously), exactly
one of the two calls should succeed. As it stands now, you might have
a comp channel that starts with a refcnt of 0, have the test in
ibv_destroy_comp_channel() succeed, then have ibv_create_cq() use the
completion channel and bump the refcnt too late and also return success.
More information about the general
mailing list