| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
SDL3.Sys.Bindgen.Atomic.Unsafe
Synopsis
- sDL_TryLockSpinlock :: Ptr SDL_SpinLock -> IO CBool
- sDL_LockSpinlock :: Ptr SDL_SpinLock -> IO ()
- sDL_UnlockSpinlock :: Ptr SDL_SpinLock -> IO ()
- sDL_MemoryBarrierReleaseFunction :: IO ()
- sDL_MemoryBarrierAcquireFunction :: IO ()
- sDL_CompareAndSwapAtomicInt :: Ptr SDL_AtomicInt -> CInt -> CInt -> IO CBool
- sDL_SetAtomicInt :: Ptr SDL_AtomicInt -> CInt -> IO CInt
- sDL_GetAtomicInt :: Ptr SDL_AtomicInt -> IO CInt
- sDL_AddAtomicInt :: Ptr SDL_AtomicInt -> CInt -> IO CInt
- sDL_CompareAndSwapAtomicU32 :: Ptr SDL_AtomicU32 -> Uint32 -> Uint32 -> IO CBool
- sDL_SetAtomicU32 :: Ptr SDL_AtomicU32 -> Uint32 -> IO Uint32
- sDL_GetAtomicU32 :: Ptr SDL_AtomicU32 -> IO Uint32
- sDL_AddAtomicU32 :: Ptr SDL_AtomicU32 -> CInt -> IO Uint32
- sDL_CompareAndSwapAtomicPointer :: Ptr (Ptr Void) -> Ptr Void -> Ptr Void -> IO CBool
- sDL_SetAtomicPointer :: Ptr (Ptr Void) -> Ptr Void -> IO (Ptr Void)
- sDL_GetAtomicPointer :: Ptr (Ptr Void) -> IO (Ptr Void)
Documentation
Arguments
| :: Ptr SDL_SpinLock |
|
| -> IO CBool |
Try to lock a spin lock by setting it to a non-zero value.
Please note that spinlocks are dangerous if you don't know what you're doing. Please be careful using any sort of spinlock!
- Returns
- true if the lock succeeded, false if the lock is already held.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_LockSpinlock,sDL_UnlockSpinlock- C declaration
SDL_TryLockSpinlock, defined atSDL3/SDL_atomic.h 100:34
Since: 3.2.0
Arguments
| :: Ptr SDL_SpinLock |
|
| -> IO () |
Lock a spin lock by setting it to a non-zero value.
Please note that spinlocks are dangerous if you don't know what you're doing. Please be careful using any sort of spinlock!
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_TryLockSpinlock,sDL_UnlockSpinlock- C declaration
SDL_LockSpinlock, defined atSDL3/SDL_atomic.h 117:34
Since: 3.2.0
Arguments
| :: Ptr SDL_SpinLock |
|
| -> IO () |
Unlock a spin lock by setting it to 0.
Always returns immediately.
Please note that spinlocks are dangerous if you don't know what you're doing. Please be careful using any sort of spinlock!
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_LockSpinlock,sDL_TryLockSpinlock- C declaration
SDL_UnlockSpinlock, defined atSDL3/SDL_atomic.h 136:34
Since: 3.2.0
sDL_MemoryBarrierReleaseFunction :: IO () Source #
Insert a memory release barrier (function version).
Please refer to SDL_MemoryBarrierRelease for details. This is a function version, which might be useful if you need to use this functionality from a scripting language, etc. Also, some of the macro versions call this function behind the scenes, where more heavy lifting can happen inside of SDL. Generally, though, an app written in C/C++/etc should use the macro version, as it will be more efficient.
- Thread safety
- Obviously this function is safe to use from any thread at any time, but if you find yourself needing this, you are probably dealing with some very sensitive code; be careful!
- See also
SDL_MemoryBarrierRelease- C declaration
SDL_MemoryBarrierReleaseFunction, defined atSDL3/SDL_atomic.h 195:34
Since: 3.2.0
sDL_MemoryBarrierAcquireFunction :: IO () Source #
Insert a memory acquire barrier (function version).
Please refer to SDL_MemoryBarrierRelease for details. This is a function version, which might be useful if you need to use this functionality from a scripting language, etc. Also, some of the macro versions call this function behind the scenes, where more heavy lifting can happen inside of SDL. Generally, though, an app written in C/C++/etc should use the macro version, as it will be more efficient.
- Thread safety
- Obviously this function is safe to use from any thread at any time, but if you find yourself needing this, you are probably dealing with some very sensitive code; be careful!
- See also
SDL_MemoryBarrierAcquire- C declaration
SDL_MemoryBarrierAcquireFunction, defined atSDL3/SDL_atomic.h 215:34
Since: 3.2.0
sDL_CompareAndSwapAtomicInt Source #
Arguments
| :: Ptr SDL_AtomicInt |
|
| -> CInt |
|
| -> CInt |
|
| -> IO CBool |
Set an atomic variable to a new value if it is currently an old value.
Note: If you don't know what this function is for, you shouldn't use it!
- Returns
- true if the atomic variable was set, false otherwise.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetAtomicInt,sDL_SetAtomicInt- C declaration
SDL_CompareAndSwapAtomicInt, defined atSDL3/SDL_atomic.h 425:34
Since: 3.2.0
Arguments
| :: Ptr SDL_AtomicInt |
|
| -> CInt |
|
| -> IO CInt |
Set an atomic variable to a value.
This function also acts as a full memory barrier.
Note: If you don't know what this function is for, you shouldn't use it!
- Returns
- the previous value of the atomic variable.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetAtomicInt- C declaration
SDL_SetAtomicInt, defined atSDL3/SDL_atomic.h 445:33
Since: 3.2.0
Arguments
| :: Ptr SDL_AtomicInt |
|
| -> IO CInt |
Get the value of an atomic variable.
Note: If you don't know what this function is for, you shouldn't use it!
- Returns
- the current value of an atomic variable.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_SetAtomicInt- C declaration
SDL_GetAtomicInt, defined atSDL3/SDL_atomic.h 462:33
Since: 3.2.0
Arguments
| :: Ptr SDL_AtomicInt |
|
| -> CInt |
|
| -> IO CInt |
Add to an atomic variable.
This function also acts as a full memory barrier.
Note: If you don't know what this function is for, you shouldn't use it!
- Returns
- the previous value of the atomic variable.
- Thread safety
- It is safe to call this function from any thread.
- See also
SDL_AtomicDecRef,SDL_AtomicIncRef- C declaration
SDL_AddAtomicInt, defined atSDL3/SDL_atomic.h 483:33
Since: 3.2.0
sDL_CompareAndSwapAtomicU32 Source #
Arguments
| :: Ptr SDL_AtomicU32 |
|
| -> Uint32 |
|
| -> Uint32 |
|
| -> IO CBool |
Set an atomic variable to a new value if it is currently an old value.
Note: If you don't know what this function is for, you shouldn't use it!
- Returns
- true if the atomic variable was set, false otherwise.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetAtomicU32,sDL_SetAtomicU32- C declaration
SDL_CompareAndSwapAtomicU32, defined atSDL3/SDL_atomic.h 570:34
Since: 3.2.0
Arguments
| :: Ptr SDL_AtomicU32 |
|
| -> Uint32 |
|
| -> IO Uint32 |
Set an atomic variable to a value.
This function also acts as a full memory barrier.
Note: If you don't know what this function is for, you shouldn't use it!
- Returns
- the previous value of the atomic variable.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetAtomicU32- C declaration
SDL_SetAtomicU32, defined atSDL3/SDL_atomic.h 590:36
Since: 3.2.0
Arguments
| :: Ptr SDL_AtomicU32 |
|
| -> IO Uint32 |
Get the value of an atomic variable.
Note: If you don't know what this function is for, you shouldn't use it!
- Returns
- the current value of an atomic variable.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_SetAtomicU32- C declaration
SDL_GetAtomicU32, defined atSDL3/SDL_atomic.h 607:36
Since: 3.2.0
Arguments
| :: Ptr SDL_AtomicU32 |
|
| -> CInt |
|
| -> IO Uint32 |
Add to an atomic variable.
This function also acts as a full memory barrier.
Note: If you don't know what this function is for, you shouldn't use it!
- Returns
- the previous value of the atomic variable.
- Thread safety
- It is safe to call this function from any thread.
- C declaration
SDL_AddAtomicU32, defined atSDL3/SDL_atomic.h 625:36
Since: 3.4.0
sDL_CompareAndSwapAtomicPointer Source #
Arguments
| :: Ptr (Ptr Void) |
|
| -> Ptr Void |
|
| -> Ptr Void |
|
| -> IO CBool |
Set a pointer to a new value if it is currently an old value.
Note: If you don't know what this function is for, you shouldn't use it!
- Returns
- true if the pointer was set, false otherwise.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_CompareAndSwapAtomicInt,sDL_GetAtomicPointer,sDL_SetAtomicPointer- C declaration
SDL_CompareAndSwapAtomicPointer, defined atSDL3/SDL_atomic.h 646:34
Since: 3.2.0
Arguments
| :: Ptr (Ptr Void) |
|
| -> Ptr Void |
|
| -> IO (Ptr Void) |
Set a pointer to a value atomically.
Note: If you don't know what this function is for, you shouldn't use it!
- Returns
- the previous value of the pointer.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_CompareAndSwapAtomicPointer,sDL_GetAtomicPointer- C declaration
SDL_SetAtomicPointer, defined atSDL3/SDL_atomic.h 665:36
Since: 3.2.0
Get the value of a pointer atomically.
Note: If you don't know what this function is for, you shouldn't use it!
- Returns
- the current value of a pointer.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_CompareAndSwapAtomicPointer,sDL_SetAtomicPointer- C declaration
SDL_GetAtomicPointer, defined atSDL3/SDL_atomic.h 683:36
Since: 3.2.0