return --*Subend;
}
+
/**
* InterlockedExchange:
* @Target: Pointer to #LONG variable to exchange @Value with.
*Target=Value;
return r;
}
+
+
+/**
+ * InterlockedExchangeAdd:
+ * @Addend: Pointer to #LONG variable to add @Value to.
+ * @Value: Value to add to @Addend value.
+ *
+ * Atomic value add of @Value to *@Addend.
+ * Currently libcaptive doesn't use multithreading
+ * and thus this function is just a simple value add now.
+ *
+ * Returns: Previous value of *@Addend;
+ */
+LONG InterlockedExchangeAdd(PLONG Addend,LONG Value)
+{
+LONG r;
+
+ /* TODO:thread */
+ r=*Addend;
+ *Addend+=Value;
+ return r;
+}