@@ -68,6 +68,8 @@ fn C.SDL_AtomicTryLock(lock_ &C.SDL_SpinLock) bool
68
68
//
69
69
// returns SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already held.
70
70
//
71
+ // NOTE This function is available since SDL 2.0.0.
72
+ //
71
73
// See also: SDL_AtomicLock
72
74
// See also: SDL_AtomicUnlock
73
75
pub fn atomic_try_lock (lock_ & SpinLock) bool {
@@ -83,6 +85,8 @@ fn C.SDL_AtomicLock(lock_ &C.SDL_SpinLock)
83
85
//
84
86
// `lock_` a pointer to a lock variable
85
87
//
88
+ // NOTE This function is available since SDL 2.0.0.
89
+ //
86
90
// See also: SDL_AtomicTryLock
87
91
// See also: SDL_AtomicUnlock
88
92
pub fn atomic_lock (lock_ & SpinLock) {
@@ -125,6 +129,8 @@ pub fn atomic_unlock(lock_ &SpinLock) {
125
129
//
126
130
// For more information on these semantics, take a look at the blog post:
127
131
// http://preshing.com/20120913/acquire-and-release-semantics
132
+ //
133
+ // NOTE This function is available since SDL 2.0.6.
128
134
fn C.SDL_MemoryBarrierReleaseFunction ()
129
135
pub fn memory_barrier_release_function () {
130
136
C.SDL_MemoryBarrierReleaseFunction ()
@@ -177,6 +183,8 @@ fn C.SDL_AtomicSet(a &C.SDL_atomic_t, v int) int
177
183
// `v` the desired value
178
184
// returns the previous value of the atomic variable.
179
185
//
186
+ // NOTE This function is available since SDL 2.0.2.
187
+ //
180
188
// See also: SDL_AtomicGet
181
189
pub fn atomic_set (a & AtomicT, v int ) int {
182
190
return unsafe { C.SDL_AtomicSet (& C.SDL_atomic_t (a), v) }
@@ -192,6 +200,8 @@ fn C.SDL_AtomicGet(a &C.SDL_atomic_t) int
192
200
// `a` a pointer to an SDL_atomic_t variable
193
201
// returns the current value of an atomic variable.
194
202
//
203
+ // NOTE This function is available since SDL 2.0.2.
204
+ //
195
205
// See also: SDL_AtomicSet
196
206
pub fn atomic_get (a & AtomicT) int {
197
207
return unsafe { C.SDL_AtomicGet (& C.SDL_atomic_t (a)) }
@@ -210,6 +220,8 @@ fn C.SDL_AtomicAdd(a &C.SDL_atomic_t, v int) int
210
220
// `v` the desired value to add
211
221
// returns The previous value of the atomic variable.
212
222
//
223
+ // NOTE This function is available since SDL 2.0.2.
224
+ //
213
225
// See also: SDL_AtomicDecRef
214
226
// See also: SDL_AtomicIncRef
215
227
pub fn atomic_add (a & AtomicT, v int ) int {
@@ -260,7 +272,7 @@ pub fn atomic_cas_ptr(a voidptr, oldval voidptr, newval voidptr) bool {
260
272
261
273
fn C.SDL_AtomicSetPtr (a voidptr , v voidptr ) voidptr
262
274
263
- // atomic_set_ptr set a pointer to a value atomically.
275
+ // atomic_set_ptr sets a pointer to a value atomically.
264
276
//
265
277
// NOTE If you don't know what this function is for, you shouldn't use
266
278
// it!
@@ -269,6 +281,8 @@ fn C.SDL_AtomicSetPtr(a voidptr, v voidptr) voidptr
269
281
// `v` the desired pointer value
270
282
// returns the previous value of the pointer.
271
283
//
284
+ // NOTE This function is available since SDL 2.0.2.
285
+ //
272
286
// See also: SDL_AtomicCASPtr
273
287
// See also: SDL_AtomicGetPtr
274
288
//
@@ -279,7 +293,18 @@ pub fn atomic_set_ptr(a voidptr, v voidptr) voidptr {
279
293
280
294
fn C.SDL_AtomicGetPtr (a voidptr ) voidptr
281
295
282
- // atomic_get_ptr gets the value of a pointer atomically.
296
+ // atomic_get_ptr gets a pointer to a value atomically.
297
+ //
298
+ // NOTE If you don't know what this function is for, you shouldn't use
299
+ // it!
300
+ //
301
+ // `a` a pointer to a pointer
302
+ // returns the current value of a pointer.
303
+ //
304
+ // NOTE This function is available since SDL 2.0.2.
305
+ //
306
+ // See also: SDL_AtomicCASPtr
307
+ // See also: SDL_AtomicSetPtr
283
308
//
284
309
// `a`'s C type is `void **a`
285
310
pub fn atomic_get_ptr (a voidptr ) voidptr {
0 commit comments