targets/Win32/plc_Win32_main.c
changeset 2174 55611282b909
parent 1903 084256be3658
child 3295 0375d801fff7
--- a/targets/Win32/plc_Win32_main.c	Thu Jun 07 13:45:35 2018 +0300
+++ b/targets/Win32/plc_Win32_main.c	Thu Jun 07 14:04:45 2018 +0300
@@ -54,11 +54,19 @@
     }
 }
 
+int PLC_shutdown;
+
+int ForceSaveRetainReq(void) {
+    return PLC_shutdown;
+}
+
 /* Variable used to stop plcloop thread */
 void PlcLoop()
 {
-    while(WaitForSingleObject(PLC_timer, INFINITE) == WAIT_OBJECT_0)
-    {
+    PLC_shutdown = 0;
+    while(!PLC_shutdown) {
+        if (WaitForSingleObject(PLC_timer, INFINITE) != WAIT_OBJECT_0)
+            PLC_shutdown = 1;
         PLC_timer_notify();
     }
 }
@@ -241,43 +249,6 @@
 	WaitForSingleObject(python_sem, INFINITE);
 }
 
-#ifndef HAVE_RETAIN
-void InitRetain(void)
-{
-}
-
-void CleanupRetain(void)
-{
-}
-
-int CheckRetainBuffer(void)
-{
-	return 1;
-}
-
-void ValidateRetainBuffer(void)
-{
-}
-
-void InValidateRetainBuffer(void)
-{
-}
-
-void Retain(unsigned int offset, unsigned int count, void * p)
-{
-    /*
-    unsigned int position;
-    for(position=0; position<count; position++ ){
-        printf("%d : 0x%2.2x\n", offset+position, ((char*)p)[position]);
-    }
-    */
-}
-
-void Remind(unsigned int offset, unsigned int count, void *p)
-{
-}
-#endif // !HAVE_RETAIN
-
 static void __attribute__((constructor))
 beremiz_dll_init(void)
 {