[ofw] Using SetWaitableTimer from an ibal callback

Tzachi Dar tzachid at mellanox.co.il
Mon Sep 21 10:32:10 PDT 2009


Hi All,
 
I have tried calling SetWaitableTimer from within a callback that I have
received.
I have noticed that after the call succeeds two times it is never called
again.
 
The main reason seems to be that in the function
__cl_thread_pool_routine there is a code that exits if an apc was
received. However, the SetWaitableTimer function does create an apc.
 
So I wander if it will be fine to change the code from:
 while( !p_thread_pool->exit )
 {
  /* Wait for the specified event to occur. */
  status = cl_event_wait_on( &p_thread_pool->wakeup_event, 
       EVENT_NO_TIMEOUT, TRUE );
 
  /* See if we've been signalled to end execution. */
  if( (p_thread_pool->exit) || (status == CL_NOT_DONE) )
   break;
 
  /* The event has been signalled.  Invoke the callback. */
  (*p_thread_pool->pfn_callback)( (void*)p_thread_pool->context );
 }
 
to only check for p_thread_pool->exit (that is reomove the red part).
 
Thanks
Tzachi
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20090921/480ba189/attachment.html>


More information about the ofw mailing list