for(;;){
/* before start polling */
- DbgPrint("Before polling.\n");
for (;;) {
status = KeWaitForMultipleObjects( 2, wait_objects,
WaitAny, Executive, KernelMode, FALSE, NULL, NULL );
if ( status == STATUS_WAIT_0 ){/* thread stopped */
- DbgPrint("Signaled to stop polling.\n");
break;
}
/* start polling */
if ( status == STATUS_WAIT_1 ){
- DbgPrint("Signaled to start polling.\n");
break;
}
if ( status == STATUS_WAIT_0 ) continue;/* thread stopped, wait for start again */
/* polling */
- DbgPrint("Start polling.\n");
wait_time.QuadPart = -(int64_t)(((uint64_t)POLLING_INTERVAL_MS) * 10000);
for (;;) {
//mlx4_interrupt( NULL, &priv->dev );
Executive, KernelMode, FALSE, &wait_time );
if ( status == STATUS_SUCCESS ) {
//KeClearEvent(&priv->eq_table.thread_stop_event);
- DbgPrint("Signaled to stop polling while in polling mode.\n");
break; /* thread stopped */
}
}
if(priv->eq_table.bTerminated) break;
}
- DbgPrint("Polling thread terminated.\n");
PsTerminateSystemThread(STATUS_SUCCESS);
}
if (res) \r
// We are now waiting for the object to reach -MAX_OPERATIONS\r
KeWaitForSingleObject( &p_shutter->event, Executive, KernelMode, FALSE, NULL );\r
-\r
- ASSERT(p_shutter->cnt == -MAX_OPERATIONS);\r
}\r
\r
static inline void shutter_alive(shutter_t * p_shutter)\r
{\r
long res = 0;\r
- long old_cnt = 0;\r
- old_cnt = p_shutter->cnt;\r
- ASSERT(p_shutter->cnt == -MAX_OPERATIONS);\r
- // Mark the counter as locked\r
+ \r
+ // Mark the counter as alive\r
res = InterlockedExchangeAdd(&p_shutter->cnt, MAX_OPERATIONS);\r
ASSERT(res < 0);\r
}\r