]> git.openfabrics.org - ~shefty/rdma-win.git/commit
libibverbs/comp_mgr: fix hang during destruction
authorshefty <shefty@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 5 Aug 2009 23:43:36 +0000 (23:43 +0000)
committershefty <shefty@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 5 Aug 2009 23:43:36 +0000 (23:43 +0000)
commit3e18d0333a84abc70619e10781cd4e9a92852d82
tree0e8205c4eeff032b2a1fe62e4623bef7352d2d61
parenta28d389304826066500526f65854847a1f5e5a14
libibverbs/comp_mgr: fix hang during destruction

The completion manager abstraction can hang during cleanup.  The hang
occurs when the user calls CompManagerCancel before calling CompManagerClose,
and the user is not waiting for events.  In this case, the completion manager
thread will pull the cancel request from the IO completion port and queue it
with the manager.  When CompManagerClose is called, it calls CompManagerCancel
to signal the thread to check the running state.  However, the completion
manager's event structure is still marked busy from the user's CompManagerCancel
call.

The result is that the completion manager thread does not receive the
signal to check the running flag and remains asleep.  Fix this by using a
different completion entry to signal the thread during destruction than that
used to cancel a CompManagerPoll event.

This fixes occasional hangs running dapltest with both the rdma_cm and socket
cm providers.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
git-svn-id: svn://openib.tc.cornell.edu/gen1@2330 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86
branches/winverbs/etc/user/comp_channel.cpp