]> git.openfabrics.org - ~ardavis/dapl.git/commitdiff
The HCA should not be closed until all resources have been released.
authorSean Hefty <sean.hefty@intel.com>
Wed, 14 Oct 2009 16:34:18 +0000 (09:34 -0700)
committerArlin Davis <arlin.r.davis@intel.com>
Wed, 14 Oct 2009 16:34:18 +0000 (09:34 -0700)
This results in a hang on windows, since closing the device frees
the event processing thread.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
dapl/openib_ucm/device.c

index 90a044e66f75a5d3973b8f29334a430a7991805c..4f26e87e7c5e51fc050e9f761212a15d725a7b6c 100644 (file)
@@ -354,16 +354,17 @@ DAT_RETURN dapls_ib_close_hca(IN DAPL_HCA * hca_ptr)
                }
        }
 
+       dapl_os_lock_destroy(&hca_ptr->ib_trans.lock);
+       dapl_os_lock_destroy(&hca_ptr->ib_trans.llock);
+       destroy_cr_pipe(hca_ptr); /* no longer need pipe */
+       ucm_service_destroy(hca_ptr);
+
        if (hca_ptr->ib_hca_handle != IB_INVALID_HANDLE) {
                if (ibv_close_device(hca_ptr->ib_hca_handle))
                        return (dapl_convert_errno(errno, "ib_close_device"));
                hca_ptr->ib_hca_handle = IB_INVALID_HANDLE;
        }
 
-       dapl_os_lock_destroy(&hca_ptr->ib_trans.lock);
-       dapl_os_lock_destroy(&hca_ptr->ib_trans.llock);
-       destroy_cr_pipe(hca_ptr); /* no longer need pipe */
-       ucm_service_destroy(hca_ptr);
        return (DAT_SUCCESS);
 }