]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
[WSD] Fix race between CQ thread info cleanup and thread exit.
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Sun, 4 Jun 2006 19:37:37 +0000 (19:37 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Sun, 4 Jun 2006 19:37:37 +0000 (19:37 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1@372 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

trunk/ulp/wsd/user/ibsp_iblow.c

index dc545d86f62a29c89ea1496e2ac77fa7089e18ca..f793b5c18cf4ec9b2b50aa4c749fc1b69c00d846 100644 (file)
@@ -639,6 +639,7 @@ ib_destroy_cq_tinfo(
        ib_wc_t *done_wclist;\r
        ib_api_status_t status;\r
        HANDLE h_cq_thread;\r
+       DWORD cq_thread_id;\r
 \r
        IBSP_ENTER( IBSP_DBG_HW );\r
 \r
@@ -684,16 +685,17 @@ ib_destroy_cq_tinfo(
                   reference cq_tinfo after signaling  */\r
                h_cq_thread = cq_tinfo->ib_cq_thread;\r
                cq_tinfo->ib_cq_thread = NULL;\r
+               cq_thread_id = cq_tinfo->ib_cq_thread_id;\r
 \r
                cq_tinfo->ib_cq_thread_exit_wanted = TRUE;\r
                cl_waitobj_signal( cq_tinfo->cq_waitobj );\r
 \r
                /* Wait for ib_cq_thread to die, if we are not running on it */\r
-               if( GetCurrentThreadId() != cq_tinfo->ib_cq_thread_id )\r
+               if( GetCurrentThreadId() != cq_thread_id )\r
                {\r
                        fzprint(("%s():%d:0x%x:0x%x: Waiting for ib_cq_thread=0x%x to die\n",\r
                                         __FUNCTION__, __LINE__, GetCurrentProcessId(), GetCurrentThreadId(),\r
-                                        cq_tinfo->ib_cq_thread_id ));\r
+                                        cq_thread_id ));\r
                        if( WaitForSingleObject( h_cq_thread, INFINITE ) != WAIT_OBJECT_0 )\r
                        {\r
                                IBSP_ERROR( ("WaitForSingleObject failed\n") );\r