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
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