Mercurial > sdl-ios-xcode
annotate include/SDL_atomic.h @ 3272:e8f63b28947d
Removed outdated Dreamcast support
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 19 Sep 2009 07:21:22 +0000 |
parents | 72b542f34739 |
children | d3baf5ac4e37 |
rev | line source |
---|---|
3180
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
1 /* |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
2 SDL - Simple DirectMedia Layer |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
3 Copyright (C) 1997-2006 Sam Lantinga |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
4 |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
5 This library is free software; you can redistribute it and/or |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
6 modify it under the terms of the GNU Lesser General Public |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
7 License as published by the Free Software Foundation; either |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
8 version 2.1 of the License, or (at your option) any later version. |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
9 |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
10 This library is distributed in the hope that it will be useful, |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
13 Lesser General Public License for more details. |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
14 |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
15 You should have received a copy of the GNU Lesser General Public |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
16 License along with this library; if not, write to the Free Software |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
18 |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
19 Sam Lantinga |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
20 slouken@libsdl.org |
3261
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
21 |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
22 Contributed by Bob Pendleton, bob@pendleton.com |
3180
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
23 */ |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
24 |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
25 /** |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
26 * \file SDL_atomic.h |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
27 * |
3199
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
28 * Atomic operations. |
3180
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
29 */ |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
30 |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
31 #ifndef _SDL_atomic_h_ |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
32 #define _SDL_atomic_h_ |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
33 |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
34 #include "SDL_stdinc.h" |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
35 #include "SDL_platform.h" |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
36 |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
37 #include "begin_code.h" |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
38 |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
39 /* Set up for C function definitions, even when using C++ */ |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
40 #ifdef __cplusplus |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
41 /* *INDENT-OFF* */ |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
42 extern "C" { |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
43 /* *INDENT-ON* */ |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
44 #endif |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
45 |
3199
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
46 /** |
3202
3aa519a5c676
I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents:
3199
diff
changeset
|
47 * These operations may, or may not, actually be implemented using |
3aa519a5c676
I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents:
3199
diff
changeset
|
48 * processor specific atomic operations. When possible they are |
3aa519a5c676
I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents:
3199
diff
changeset
|
49 * implemented as true processor specific atomic operations. When that |
3aa519a5c676
I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents:
3199
diff
changeset
|
50 * is not possible the are implemented using locks that *do* use the |
3261
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
51 * available atomic operations. |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
52 * |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
53 * At the very minimum spin locks must be implemented. Without spin |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
54 * locks it is not possible (AFAICT) to emulate the rest of the atomic |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
55 * operations. |
3199
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
56 */ |
3186 | 57 |
3199
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
58 /* Function prototypes */ |
3180
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
59 |
3261
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
60 /** |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
61 * SDL AtomicLock. |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
62 * |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
63 * The spin lock functions and type are required and can not be |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
64 * emulated because they are used in the emulation code. |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
65 */ |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
66 |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
67 typedef volatile Uint32 SDL_SpinLock; |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
68 |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
69 /** |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
70 * \fn void SDL_AtomicLock(SDL_SpinLock *lock); |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
71 * |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
72 * \brief Lock a spin lock by setting it to a none zero value. |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
73 * |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
74 * \param lock points to the lock. |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
75 * |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
76 */ |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
77 extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock); |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
78 |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
79 /** |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
80 * \fn void SDL_AtomicUnlock(SDL_SpinLock *lock); |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
81 * |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
82 * \brief Unlock a spin lock by setting it to 0. Always returns immediately |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
83 * |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
84 * \param lock points to the lock. |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
85 * |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
86 */ |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
87 extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock); |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
88 |
3202
3aa519a5c676
I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents:
3199
diff
changeset
|
89 /* 32 bit atomic operations */ |
3aa519a5c676
I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents:
3199
diff
changeset
|
90 |
3199
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
91 /** |
3216
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
92 * \fn SDL_bool SDL_AtomicTestThenSet32(volatile Uint32 * ptr); |
3199
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
93 * |
3261
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
94 * \brief Check to see if *ptr == 0 and set it to 1. |
3199
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
95 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
96 * \return SDL_True if the value pointed to by ptr was zero and |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
97 * SDL_False if it was not zero |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
98 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
99 * \param ptr points to the value to be tested and set. |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
100 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
101 */ |
3216
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
102 extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTestThenSet32(volatile Uint32 * ptr); |
3237
916f396fe65d
Start of redesign, getting rid of 8 and 16 bit operations in .h and test files.
Bob Pendleton <bob@pendleton.com>
parents:
3216
diff
changeset
|
103 |
3199
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
104 /** |
3216
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
105 * \fn void SDL_AtomicClear32(volatile Uint32 * ptr); |
3199
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
106 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
107 * \brief set the value pointed to by ptr to be zero. |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
108 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
109 * \param ptr address of the value to be set to zero |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
110 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
111 */ |
3216
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
112 extern DECLSPEC void SDLCALL SDL_AtomicClear32(volatile Uint32 * ptr); |
3237
916f396fe65d
Start of redesign, getting rid of 8 and 16 bit operations in .h and test files.
Bob Pendleton <bob@pendleton.com>
parents:
3216
diff
changeset
|
113 |
3199
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
114 /** |
3216
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
115 * \fn Uint32 SDL_AtomicFetchThenIncrement32(volatile Uint32 * ptr); |
3199
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
116 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
117 * \brief fetch the current value of *ptr and then increment that |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
118 * value in place. |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
119 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
120 * \return the value before it was incremented. |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
121 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
122 * \param ptr address of the value to fetch and increment |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
123 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
124 */ |
3216
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
125 extern DECLSPEC Uint32 SDLCALL SDL_AtomicFetchThenIncrement32(volatile Uint32 * ptr); |
3237
916f396fe65d
Start of redesign, getting rid of 8 and 16 bit operations in .h and test files.
Bob Pendleton <bob@pendleton.com>
parents:
3216
diff
changeset
|
126 |
3199
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
127 /** |
3216
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
128 * \fn Uint32 SDL_AtomicFetchThenDecrement32(volatile Uint32 * ptr); |
3199
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
129 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
130 * \brief fetch *ptr and then decrement the value in place. |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
131 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
132 * \return the value before it was decremented. |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
133 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
134 * \param ptr address of the value to fetch and drement |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
135 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
136 */ |
3216
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
137 extern DECLSPEC Uint32 SDLCALL SDL_AtomicFetchThenDecrement32(volatile Uint32 * ptr); |
3237
916f396fe65d
Start of redesign, getting rid of 8 and 16 bit operations in .h and test files.
Bob Pendleton <bob@pendleton.com>
parents:
3216
diff
changeset
|
138 |
3199
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
139 /** |
3216
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
140 * \fn Uint32 SDL_AtomicFetchThenAdd32(volatile Uint32 * ptr, Uint32 value); |
3199
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
141 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
142 * \brief fetch the current value at ptr and then add value to *ptr. |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
143 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
144 * \return *ptr before the addition took place. |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
145 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
146 * \param ptr the address of data we are changing. |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
147 * \param value the value to add to *ptr. |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
148 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
149 */ |
3216
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
150 extern DECLSPEC Uint32 SDLCALL SDL_AtomicFetchThenAdd32(volatile Uint32 * ptr, Uint32 value); |
3237
916f396fe65d
Start of redesign, getting rid of 8 and 16 bit operations in .h and test files.
Bob Pendleton <bob@pendleton.com>
parents:
3216
diff
changeset
|
151 |
3199
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
152 /** |
3216
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
153 * \fn Uint32 SDL_AtomicFetchThenSubtract32(volatile Uint32 * ptr, Uint32 value); |
3199
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
154 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
155 * \brief Fetch *ptr and then subtract value from it. |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
156 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
157 * \return *ptr before the subtraction took place. |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
158 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
159 * \param ptr the address of the data being changed. |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
160 * \param value the value to subtract from *ptr. |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
161 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
162 */ |
3216
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
163 extern DECLSPEC Uint32 SDLCALL SDL_AtomicFetchThenSubtract32(volatile Uint32 * ptr, Uint32 value); |
3237
916f396fe65d
Start of redesign, getting rid of 8 and 16 bit operations in .h and test files.
Bob Pendleton <bob@pendleton.com>
parents:
3216
diff
changeset
|
164 |
3199
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
165 /** |
3216
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
166 * \fn Uint32 SDL_AtomicIncrementThenFetch32(volatile Uint32 * ptr); |
3199
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
167 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
168 * \brief Add one to the data pointed to by ptr and return that value. |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
169 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
170 * \return the incremented value. |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
171 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
172 * \param ptr address of the data to increment. |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
173 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
174 */ |
3216
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
175 extern DECLSPEC Uint32 SDLCALL SDL_AtomicIncrementThenFetch32(volatile Uint32 * ptr); |
3237
916f396fe65d
Start of redesign, getting rid of 8 and 16 bit operations in .h and test files.
Bob Pendleton <bob@pendleton.com>
parents:
3216
diff
changeset
|
176 |
3199
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
177 /** |
3216
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
178 * \fn Uint32 SDL_AtomicDecrementThenFetch32(volatile Uint32 * ptr); |
3199
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
179 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
180 * \brief Subtract one from data pointed to by ptr and return the new value. |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
181 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
182 * \return The decremented value. |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
183 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
184 * \param ptr The address of the data to decrement. |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
185 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
186 */ |
3216
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
187 extern DECLSPEC Uint32 SDLCALL SDL_AtomicDecrementThenFetch32(volatile Uint32 * ptr); |
3237
916f396fe65d
Start of redesign, getting rid of 8 and 16 bit operations in .h and test files.
Bob Pendleton <bob@pendleton.com>
parents:
3216
diff
changeset
|
188 |
3199
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
189 /** |
3216
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
190 * \fn Uint32 SDL_AtomicAddThenFetch32(volatile Uint32 * ptr, Uint32 value); |
3199
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
191 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
192 * \brief Add value to the data pointed to by ptr and return result. |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
193 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
194 * \return The sum of *ptr and value. |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
195 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
196 * \param ptr The address of the data to be modified. |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
197 * \param value The value to be added. |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
198 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
199 */ |
3216
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
200 extern DECLSPEC Uint32 SDLCALL SDL_AtomicAddThenFetch32(volatile Uint32 * ptr, Uint32 value); |
3237
916f396fe65d
Start of redesign, getting rid of 8 and 16 bit operations in .h and test files.
Bob Pendleton <bob@pendleton.com>
parents:
3216
diff
changeset
|
201 |
3199
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
202 /** |
3216
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
203 * \fn Uint32 SDL_AtomicSubtractThenFetch32(volatile Uint32 * ptr, Uint32 value); |
3199
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
204 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
205 * \brief Subtract value from the data pointed to by ptr and return the result. |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
206 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
207 * \return the difference between *ptr and value. |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
208 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
209 * \param ptr The address of the data to be modified. |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
210 * \param value The value to be subtracted. |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
211 * |
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
212 */ |
3216
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
213 extern DECLSPEC Uint32 SDLCALL SDL_AtomicSubtractThenFetch32(volatile Uint32 * ptr, Uint32 value); |
3180
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
214 |
3202
3aa519a5c676
I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents:
3199
diff
changeset
|
215 /* 64 bit atomic operations */ |
3199
3e1bf2b8bd81
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents:
3187
diff
changeset
|
216 #ifdef SDL_HAS_64BIT_TYPE |
3180
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
217 |
3216
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
218 extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTestThenSet64(volatile Uint64 * ptr); |
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
219 extern DECLSPEC void SDLCALL SDL_AtomicClear64(volatile Uint64 * ptr); |
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
220 extern DECLSPEC Uint64 SDLCALL SDL_AtomicFetchThenIncrement64(volatile Uint64 * ptr); |
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
221 extern DECLSPEC Uint64 SDLCALL SDL_AtomicFetchThenDecrement64(volatile Uint64 * ptr); |
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
222 extern DECLSPEC Uint64 SDLCALL SDL_AtomicFetchThenAdd64(volatile Uint64 * ptr, Uint64 value); |
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
223 extern DECLSPEC Uint64 SDLCALL SDL_AtomicFetchThenSubtract64(volatile Uint64 * ptr, Uint64 value); |
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
224 extern DECLSPEC Uint64 SDLCALL SDL_AtomicIncrementThenFetch64(volatile Uint64 * ptr); |
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
225 extern DECLSPEC Uint64 SDLCALL SDL_AtomicDecrementThenFetch64(volatile Uint64 * ptr); |
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
226 extern DECLSPEC Uint64 SDLCALL SDL_AtomicAddThenFetch64(volatile Uint64 * ptr, Uint64 value); |
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
227 extern DECLSPEC Uint64 SDLCALL SDL_AtomicSubtractThenFetch64(volatile Uint64 * ptr, Uint64 value); |
3202
3aa519a5c676
I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents:
3199
diff
changeset
|
228 #endif /* SDL_HAS_64BIT_TYPE */ |
3180
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
229 |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
230 /* Ends C function definitions when using C++ */ |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
231 #ifdef __cplusplus |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
232 /* *INDENT-OFF* */ |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
233 } |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
234 /* *INDENT-ON* */ |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
235 #endif |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
236 |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
237 #include "close_code.h" |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
238 |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
239 #endif /* _SDL_atomic_h_ */ |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
240 |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
241 /* vi: set ts=4 sw=4 expandtab: */ |