From 7f713714b70e17fc7de8d2a613ef0319cf055126 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Tue, 22 Oct 2024 17:48:51 +0000 Subject: [PATCH] Sync SDL3 header -> wiki --- SDL3/SDL_ClearError.md | 4 ++++ SDL3/SDL_Delay.md | 4 ++++ SDL3/SDL_DelayNS.md | 4 ++++ SDL3/SDL_DelayPrecise.md | 4 ++++ SDL3/SDL_GetCPUCacheLineSize.md | 4 ++++ SDL3/SDL_GetError.md | 4 ++++ SDL3/SDL_GetNumLogicalCPUCores.md | 4 ++++ SDL3/SDL_GetPerformanceCounter.md | 4 ++++ SDL3/SDL_GetPerformanceFrequency.md | 4 ++++ SDL3/SDL_GetSIMDAlignment.md | 4 ++++ SDL3/SDL_GetSystemRAM.md | 4 ++++ SDL3/SDL_GetTicks.md | 4 ++++ SDL3/SDL_GetTicksNS.md | 4 ++++ SDL3/SDL_HasARMSIMD.md | 4 ++++ SDL3/SDL_HasAVX.md | 4 ++++ SDL3/SDL_HasAVX2.md | 4 ++++ SDL3/SDL_HasAVX512F.md | 4 ++++ SDL3/SDL_HasAltiVec.md | 4 ++++ SDL3/SDL_HasLASX.md | 4 ++++ SDL3/SDL_HasLSX.md | 4 ++++ SDL3/SDL_HasMMX.md | 4 ++++ SDL3/SDL_HasNEON.md | 4 ++++ SDL3/SDL_HasSSE.md | 4 ++++ SDL3/SDL_HasSSE2.md | 4 ++++ SDL3/SDL_HasSSE3.md | 4 ++++ SDL3/SDL_HasSSE41.md | 4 ++++ SDL3/SDL_HasSSE42.md | 4 ++++ SDL3/SDL_OutOfMemory.md | 4 ++++ SDL3/SDL_RemoveTimer.md | 4 ++++ SDL3/SDL_SetError.md | 4 ++++ SDL3/SDL_SetErrorV.md | 4 ++++ SDL3/SDL_bsearch.md | 4 ++++ SDL3/SDL_bsearch_r.md | 8 ++++++-- SDL3/SDL_qsort.md | 4 ++++ SDL3/SDL_qsort_r.md | 8 ++++++-- 35 files changed, 144 insertions(+), 4 deletions(-) diff --git a/SDL3/SDL_ClearError.md b/SDL3/SDL_ClearError.md index d876a3a18..90e0e0ee6 100644 --- a/SDL3/SDL_ClearError.md +++ b/SDL3/SDL_ClearError.md @@ -17,6 +17,10 @@ bool SDL_ClearError(void); (bool) Returns true. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_Delay.md b/SDL3/SDL_Delay.md index a76173c46..26eee3098 100644 --- a/SDL3/SDL_Delay.md +++ b/SDL3/SDL_Delay.md @@ -25,6 +25,10 @@ This function waits a specified number of milliseconds before returning. It waits at least the specified time, but possibly longer due to OS scheduling. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_DelayNS.md b/SDL3/SDL_DelayNS.md index ce7adaf46..8fc78f003 100644 --- a/SDL3/SDL_DelayNS.md +++ b/SDL3/SDL_DelayNS.md @@ -25,6 +25,10 @@ This function waits a specified number of nanoseconds before returning. It waits at least the specified time, but possibly longer due to OS scheduling. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_DelayPrecise.md b/SDL3/SDL_DelayPrecise.md index 0a3e924a2..2a9cfaddf 100644 --- a/SDL3/SDL_DelayPrecise.md +++ b/SDL3/SDL_DelayPrecise.md @@ -25,6 +25,10 @@ This function waits a specified number of nanoseconds before returning. It will attempt to wait as close to the requested time as possible, busy waiting if necessary, but could return later due to OS scheduling. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.1.4. diff --git a/SDL3/SDL_GetCPUCacheLineSize.md b/SDL3/SDL_GetCPUCacheLineSize.md index 75de8ed8e..f46dfa41b 100644 --- a/SDL3/SDL_GetCPUCacheLineSize.md +++ b/SDL3/SDL_GetCPUCacheLineSize.md @@ -22,6 +22,10 @@ int SDL_GetCPUCacheLineSize(void); This is useful for determining multi-threaded structure padding or SIMD prefetch sizes. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_GetError.md b/SDL3/SDL_GetError.md index 8ad03d426..1633c2042 100644 --- a/SDL3/SDL_GetError.md +++ b/SDL3/SDL_GetError.md @@ -42,6 +42,10 @@ The returned value is a thread-local string which will remain valid until the current thread's error string is changed. The caller should make a copy if the value is needed after the next SDL API call. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_GetNumLogicalCPUCores.md b/SDL3/SDL_GetNumLogicalCPUCores.md index 370507a36..295a108df 100644 --- a/SDL3/SDL_GetNumLogicalCPUCores.md +++ b/SDL3/SDL_GetNumLogicalCPUCores.md @@ -19,6 +19,10 @@ int SDL_GetNumLogicalCPUCores(void); technologies such as hyperthreading, the number of logical cores may be more than the number of physical cores. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_GetPerformanceCounter.md b/SDL3/SDL_GetPerformanceCounter.md index 129c1482c..7fca5a794 100644 --- a/SDL3/SDL_GetPerformanceCounter.md +++ b/SDL3/SDL_GetPerformanceCounter.md @@ -25,6 +25,10 @@ The counter values are only meaningful relative to each other. Differences between values can be converted to times by using [SDL_GetPerformanceFrequency](SDL_GetPerformanceFrequency)(). +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_GetPerformanceFrequency.md b/SDL3/SDL_GetPerformanceFrequency.md index 4bb75b285..9d4b85582 100644 --- a/SDL3/SDL_GetPerformanceFrequency.md +++ b/SDL3/SDL_GetPerformanceFrequency.md @@ -17,6 +17,10 @@ Uint64 SDL_GetPerformanceFrequency(void); (Uint64) Returns a platform-specific count per second. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_GetSIMDAlignment.md b/SDL3/SDL_GetSIMDAlignment.md index f4e074baf..49db4df9b 100644 --- a/SDL3/SDL_GetSIMDAlignment.md +++ b/SDL3/SDL_GetSIMDAlignment.md @@ -29,6 +29,10 @@ instruction sets SDL knows about, so if your SDL build doesn't have support it sees and not 64 for the AVX-512 instructions that exist but SDL doesn't know about. Plan accordingly. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_GetSystemRAM.md b/SDL3/SDL_GetSystemRAM.md index 6cd425a08..37f7dec06 100644 --- a/SDL3/SDL_GetSystemRAM.md +++ b/SDL3/SDL_GetSystemRAM.md @@ -17,6 +17,10 @@ int SDL_GetSystemRAM(void); (int) Returns the amount of RAM configured in the system in MiB. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_GetTicks.md b/SDL3/SDL_GetTicks.md index 01a961893..2f0cd6489 100644 --- a/SDL3/SDL_GetTicks.md +++ b/SDL3/SDL_GetTicks.md @@ -18,6 +18,10 @@ Uint64 SDL_GetTicks(void); (Uint64) Returns an unsigned 64-bit value representing the number of milliseconds since the SDL library initialized. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_GetTicksNS.md b/SDL3/SDL_GetTicksNS.md index 513bcdfa9..7a09521ec 100644 --- a/SDL3/SDL_GetTicksNS.md +++ b/SDL3/SDL_GetTicksNS.md @@ -18,6 +18,10 @@ Uint64 SDL_GetTicksNS(void); (Uint64) Returns an unsigned 64-bit value representing the number of nanoseconds since the SDL library initialized. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_HasARMSIMD.md b/SDL3/SDL_HasARMSIMD.md index 564c4ae8c..73945d6ea 100644 --- a/SDL3/SDL_HasARMSIMD.md +++ b/SDL3/SDL_HasARMSIMD.md @@ -23,6 +23,10 @@ This is different from ARM NEON, which is a different instruction set. This always returns false on CPUs that aren't using ARM instruction sets. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_HasAVX.md b/SDL3/SDL_HasAVX.md index ddd6daa73..204483ea0 100644 --- a/SDL3/SDL_HasAVX.md +++ b/SDL3/SDL_HasAVX.md @@ -21,6 +21,10 @@ bool SDL_HasAVX(void); This always returns false on CPUs that aren't using Intel instruction sets. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_HasAVX2.md b/SDL3/SDL_HasAVX2.md index 77c3a95a9..9a6074955 100644 --- a/SDL3/SDL_HasAVX2.md +++ b/SDL3/SDL_HasAVX2.md @@ -21,6 +21,10 @@ bool SDL_HasAVX2(void); This always returns false on CPUs that aren't using Intel instruction sets. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_HasAVX512F.md b/SDL3/SDL_HasAVX512F.md index a346ca41b..552e58ad0 100644 --- a/SDL3/SDL_HasAVX512F.md +++ b/SDL3/SDL_HasAVX512F.md @@ -21,6 +21,10 @@ bool SDL_HasAVX512F(void); This always returns false on CPUs that aren't using Intel instruction sets. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_HasAltiVec.md b/SDL3/SDL_HasAltiVec.md index 856a726b8..1b3432274 100644 --- a/SDL3/SDL_HasAltiVec.md +++ b/SDL3/SDL_HasAltiVec.md @@ -22,6 +22,10 @@ bool SDL_HasAltiVec(void); This always returns false on CPUs that aren't using PowerPC instruction sets. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_HasLASX.md b/SDL3/SDL_HasLASX.md index c420c649c..5cbe9f124 100644 --- a/SDL3/SDL_HasLASX.md +++ b/SDL3/SDL_HasLASX.md @@ -22,6 +22,10 @@ bool SDL_HasLASX(void); This always returns false on CPUs that aren't using LOONGARCH instruction sets. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_HasLSX.md b/SDL3/SDL_HasLSX.md index a2e0556d5..0596b41c4 100644 --- a/SDL3/SDL_HasLSX.md +++ b/SDL3/SDL_HasLSX.md @@ -22,6 +22,10 @@ bool SDL_HasLSX(void); This always returns false on CPUs that aren't using LOONGARCH instruction sets. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_HasMMX.md b/SDL3/SDL_HasMMX.md index cf201d387..cd3a91777 100644 --- a/SDL3/SDL_HasMMX.md +++ b/SDL3/SDL_HasMMX.md @@ -21,6 +21,10 @@ bool SDL_HasMMX(void); This always returns false on CPUs that aren't using Intel instruction sets. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_HasNEON.md b/SDL3/SDL_HasNEON.md index f466e4b67..5f032faac 100644 --- a/SDL3/SDL_HasNEON.md +++ b/SDL3/SDL_HasNEON.md @@ -21,6 +21,10 @@ bool SDL_HasNEON(void); This always returns false on CPUs that aren't using ARM instruction sets. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_HasSSE.md b/SDL3/SDL_HasSSE.md index 053888ccc..2aabffa1c 100644 --- a/SDL3/SDL_HasSSE.md +++ b/SDL3/SDL_HasSSE.md @@ -21,6 +21,10 @@ bool SDL_HasSSE(void); This always returns false on CPUs that aren't using Intel instruction sets. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_HasSSE2.md b/SDL3/SDL_HasSSE2.md index 81d5ca620..d770f4bf0 100644 --- a/SDL3/SDL_HasSSE2.md +++ b/SDL3/SDL_HasSSE2.md @@ -21,6 +21,10 @@ bool SDL_HasSSE2(void); This always returns false on CPUs that aren't using Intel instruction sets. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_HasSSE3.md b/SDL3/SDL_HasSSE3.md index 0edd3bb18..4b77eeb50 100644 --- a/SDL3/SDL_HasSSE3.md +++ b/SDL3/SDL_HasSSE3.md @@ -21,6 +21,10 @@ bool SDL_HasSSE3(void); This always returns false on CPUs that aren't using Intel instruction sets. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_HasSSE41.md b/SDL3/SDL_HasSSE41.md index d76f310cb..841deab3f 100644 --- a/SDL3/SDL_HasSSE41.md +++ b/SDL3/SDL_HasSSE41.md @@ -21,6 +21,10 @@ bool SDL_HasSSE41(void); This always returns false on CPUs that aren't using Intel instruction sets. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_HasSSE42.md b/SDL3/SDL_HasSSE42.md index 7e0474d44..d5eb3af71 100644 --- a/SDL3/SDL_HasSSE42.md +++ b/SDL3/SDL_HasSSE42.md @@ -21,6 +21,10 @@ bool SDL_HasSSE42(void); This always returns false on CPUs that aren't using Intel instruction sets. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_OutOfMemory.md b/SDL3/SDL_OutOfMemory.md index 2bc8770e6..8cbe10aae 100644 --- a/SDL3/SDL_OutOfMemory.md +++ b/SDL3/SDL_OutOfMemory.md @@ -21,6 +21,10 @@ bool SDL_OutOfMemory(void); This function does not do any memory allocation. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_RemoveTimer.md b/SDL3/SDL_RemoveTimer.md index ccc2b32e3..455ced94b 100644 --- a/SDL3/SDL_RemoveTimer.md +++ b/SDL3/SDL_RemoveTimer.md @@ -24,6 +24,10 @@ bool SDL_RemoveTimer(SDL_TimerID id); (bool) Returns true on success or false on failure; call [SDL_GetError](SDL_GetError)() for more information. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_SetError.md b/SDL3/SDL_SetError.md index 526672323..0fe7304e4 100644 --- a/SDL3/SDL_SetError.md +++ b/SDL3/SDL_SetError.md @@ -37,6 +37,10 @@ if (error_code) { } ``` +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_SetErrorV.md b/SDL3/SDL_SetErrorV.md index ef19961e7..6d9883b68 100644 --- a/SDL3/SDL_SetErrorV.md +++ b/SDL3/SDL_SetErrorV.md @@ -28,6 +28,10 @@ bool SDL_SetErrorV(const char *fmt, va_list ap); Calling this function will replace any previous error message that was set. +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.1.4. diff --git a/SDL3/SDL_bsearch.md b/SDL3/SDL_bsearch.md index 7ce2584ba..836306340 100644 --- a/SDL3/SDL_bsearch.md +++ b/SDL3/SDL_bsearch.md @@ -60,6 +60,10 @@ data key = { 2, NULL }; data *result = SDL_bsearch(&key, values, SDL_arraysize(values), sizeof(values[0]), compare); ``` +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_bsearch_r.md b/SDL3/SDL_bsearch_r.md index c8b232ef4..ac8808eba 100644 --- a/SDL3/SDL_bsearch_r.md +++ b/SDL3/SDL_bsearch_r.md @@ -50,9 +50,9 @@ int SDLCALL compare(const void *userdata, const void *a, const void *b) const data *A = (const data *)a; const data *B = (const data *)b; - if (A->n < B->n) { + if (A->key < B->key) { return (method == sort_increasing) ? -1 : 1; - } else if (B->n < A->n) { + } else if (B->key < A->key) { return (method == sort_increasing) ? 1 : -1; } else { return 0; @@ -67,6 +67,10 @@ data key = { 2, NULL }; data *result = SDL_bsearch_r(&key, values, SDL_arraysize(values), sizeof(values[0]), compare, (const void *)(uintptr_t)sort_increasing); ``` +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_qsort.md b/SDL3/SDL_qsort.md index 31dafbfa0..7df420304 100644 --- a/SDL3/SDL_qsort.md +++ b/SDL3/SDL_qsort.md @@ -53,6 +53,10 @@ data values[] = { SDL_qsort(values, SDL_arraysize(values), sizeof(values[0]), compare); ``` +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0. diff --git a/SDL3/SDL_qsort_r.md b/SDL3/SDL_qsort_r.md index a25e66d55..a2f151bc7 100644 --- a/SDL3/SDL_qsort_r.md +++ b/SDL3/SDL_qsort_r.md @@ -44,9 +44,9 @@ int SDLCALL compare(const void *userdata, const void *a, const void *b) const data *A = (const data *)a; const data *B = (const data *)b; - if (A->n < B->n) { + if (A->key < B->key) { return (method == sort_increasing) ? -1 : 1; - } else if (B->n < A->n) { + } else if (B->key < A->key) { return (method == sort_increasing) ? 1 : -1; } else { return 0; @@ -60,6 +60,10 @@ data values[] = { SDL_qsort_r(values, SDL_arraysize(values), sizeof(values[0]), compare, (const void *)(uintptr_t)sort_increasing); ``` +## Thread Safety + +It is safe to call this function from any thread. + ## Version This function is available since SDL 3.0.0.