2 * reactos inter lock increments emulation of libcaptive
3 * Copyright (C) 2002 Jan Kratochvil <project-captive@jankratochvil.net>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; exactly version 2 of June 1991 is required
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "reactos/ddk/exfuncs.h" /* self */
26 * InterlockedIncrement:
27 * @Addend: #LONG variable to be +1ed.
29 * Adds 1 to a #LONG variable and returns.
30 * Currently libcaptive doesn't use multithreading
31 * and thus this function is just a simple increment now.
33 * Returns: a negative number if the @result < %0,
34 * zero if the @result == %0
35 * a positive number if the @result > %0.
36 * The returned number need not be equal to the result!!!!
38 LONG InterlockedIncrement(PLONG Addend)
40 /* TODO:thread; really? */
46 * InterlockedDecrement:
47 * @Addend: #LONG variable to be -1ed.
49 * Subtracts 1 from a #LONG variable and returns.
50 * Currently libcaptive doesn't use multithreading
51 * and thus this function is just a simple decrement now.
53 * Returns: a negative number if the @result < %0,
54 * zero if the @result == %0
55 * a positive number if the @result > %0.
56 * The returned number need not be equal to the result!!!!
58 LONG InterlockedDecrement(PLONG Subend)
60 /* TODO:thread; really? */
66 * InterlockedExchange:
67 * @Target: Pointer to #LONG variable to exchange @Value with.
68 * @Value: Value to store to @Target value.
70 * Atomic value exchange between *@Target and @Value.
71 * Currently libcaptive doesn't use multithreading
72 * and thus this function is just a simple value exchange now.
74 * Returns: Previous value of @Target;
76 LONG InterlockedExchange(PLONG Target,LONG Value)
88 * InterlockedExchangeAdd:
89 * @Addend: Pointer to #LONG variable to add @Value to.
90 * @Value: Value to add to @Addend value.
92 * Atomic value add of @Value to *@Addend.
93 * Currently libcaptive doesn't use multithreading
94 * and thus this function is just a simple value add now.
96 * Returns: Previous value of *@Addend;
98 LONG InterlockedExchangeAdd(PLONG Addend,LONG Value)