<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18702"></HEAD>
<BODY>
<DIV><FONT size=2 face=Arial><SPAN class=794012617-21092009>Hi
All,</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN
class=794012617-21092009></SPAN></FONT> </DIV>
<DIV><FONT size=2 face=Arial><SPAN class=794012617-21092009>I have tried calling
<FONT face="Courier New">SetWaitableTimer from within a callback that I have
received.</FONT></SPAN></FONT></DIV>
<DIV><FONT size=2 face="Courier New"><SPAN class=794012617-21092009>I have
noticed that after the call succeeds two times it is never called
again.</SPAN></FONT></DIV>
<DIV><FONT size=2 face="Courier New"><SPAN
class=794012617-21092009></SPAN></FONT> </DIV>
<DIV><FONT size=2 face="Courier New"><SPAN class=794012617-21092009>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.</SPAN></FONT></DIV>
<DIV><FONT size=2 face="Courier New"><SPAN
class=794012617-21092009></SPAN></FONT> </DIV>
<DIV><FONT size=2 face="Courier New"><SPAN class=794012617-21092009>So I wander
if it will be fine to change the code from:</SPAN></FONT></DIV>
<DIV><FONT size=2 face="Courier New"><SPAN class=794012617-21092009> while(
!p_thread_pool->exit )<BR> {<BR> /* Wait for the specified
event to occur. */<BR> status = cl_event_wait_on(
&p_thread_pool->wakeup_event,
<BR> EVENT_NO_TIMEOUT, TRUE
);</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face="Courier New"><SPAN
class=794012617-21092009> /* See if we've been signalled to end
execution. */<BR> if( (p_thread_pool->exit) <FONT color=#ff0000>||
(status == CL_NOT_DONE)</FONT> )<BR> break;</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face="Courier New"><SPAN
class=794012617-21092009> /* The event has been signalled.
Invoke the callback. */<BR> (*p_thread_pool->pfn_callback)(
(void*)p_thread_pool->context );<BR> }</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face="Courier New"><SPAN class=794012617-21092009>to only
check for p_thread_pool->exit (that is reomove the red
part).</SPAN></FONT></DIV>
<DIV><FONT size=2 face="Courier New"><SPAN
class=794012617-21092009></SPAN></FONT> </DIV>
<DIV><FONT size=2 face="Courier New"><SPAN
class=794012617-21092009>Thanks</SPAN></FONT></DIV>
<DIV><FONT size=2 face="Courier New"><SPAN
class=794012617-21092009>Tzachi</SPAN></FONT></DIV>
<DIV><FONT size=2 face="Courier New"><SPAN
class=794012617-21092009></SPAN></FONT> </DIV>
<DIV><FONT size=2 face="Courier New"><SPAN
class=794012617-21092009></SPAN></FONT> </DIV></BODY></HTML>