diff -r b9271faec96e -r 7c23fac40a2a targets/Linux/plc_Linux_main.c --- 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