targets/Linux/plc_Linux_main.c
changeset 617 7c23fac40a2a
parent 614 eed1dcf311a1
child 876 179d5c455f29
--- a/targets/Linux/plc_Linux_main.c	Sun Sep 25 22:51:51 2011 +0200
+++ b/targets/Linux/plc_Linux_main.c	Mon Sep 26 00:24:04 2011 +0200
@@ -142,9 +142,11 @@
 
 int WaitDebugData(unsigned long *tick)
 {
+    int res;
+    /* Wait signal from PLC thread */
+    res = pthread_mutex_lock(&debug_wait_mutex);
     *tick = __debug_tick;
-    /* Wait signal from PLC thread */
-    return pthread_mutex_lock(&debug_wait_mutex);
+    return res;
 }
 
 /* Called by PLC thread when debug_publish finished