LPCtarget/plc_LPC_main.c
changeset 30 9cd6bc93ed89
parent 29 86fb7dc2b54e
child 31 a9c9d1fc97d3
--- a/LPCtarget/plc_LPC_main.c	Tue Mar 19 17:22:27 2013 +0900
+++ b/LPCtarget/plc_LPC_main.c	Tue Mar 19 23:19:43 2013 +0100
@@ -32,6 +32,18 @@
 	return res;
 }
 
+long AtomicCompareExchange64(long long* atomicvar,long long compared, long long exchange)
+{
+	/* No need for real atomic op on LPC,
+	 * no possible preemption between debug and PLC */
+	long long res = *atomicvar;
+	if(res == compared){
+		*atomicvar = exchange;
+	}
+	return res;
+}
+
+
 void PLC_GetTime(IEC_TIME *CURRENT_TIME)
 {
 	/* Call target GetTime function */