--- a/targets/Win32/plc_Win32_main.c Sat Mar 31 15:09:48 2012 +0200
+++ b/targets/Win32/plc_Win32_main.c Sat Mar 31 15:10:55 2012 +0200
@@ -169,9 +169,11 @@
/* from plc_debugger.c */
int WaitDebugData(unsigned long *tick)
{
+ DWORD res;
+ res = WaitForSingleObject(debug_wait_sem, INFINITE);
*tick = __debug_tick;
/* Wait signal from PLC thread */
- return WaitForSingleObject(debug_wait_sem, INFINITE) != WAIT_OBJECT_0;
+ return res != WAIT_OBJECT_0;
}
/* Called by PLC thread when debug_publish finished