SDL_SetLinuxThreadPriority(3)
β¨ SDL_SetLinuxThreadPriority β¨
okay bestie, welcome to the SDL3 FUNCTIONS corner of the man pages π this one is SDL_SetLinuxThreadPriority(3) and it's literally the "hey Linux, be nice to this thread pls" button. Linux-specific, thread-specific, immaculate vibes only π
πΈ NAME πΈ
SDL_SetLinuxThreadPriority β sets the UNIX nice value for a thread π
like. it changes how nice a thread is to everybody else. no cap.
π¦ SYNOPSIS π¦
#include <SDL3/SDL_system.h>
bool SDL_SetLinuxThreadPriority(Sint64 threadID, int priority);
she's short, she's sweet, she takes a thread ID and a priority, periodt β¨
π DESCRIPTION π
okay so here's the tea β β this function uses setpriority() if possible, and RealtimeKit if available. that's the whole trick. it tries the plain old syscall route first, and if RealtimeKit is hanging around, that's on the table too π§
π FUNCTION PARAMETERS π
threadIDβ the Unix thread ID you wanna change the priority of. yes, Unix thread ID. don't come in here with something else, she will not know her π₯priorityβ the new, Unix-specific, priority value. that's the nice value vibe you're going for π«
β RETURN VALUE β
- returns
trueon success π - returns
falseon failure π and in that case you gotta callSDL_GetError()for more information, because she will not tell you why directly. she'll just point you at the error function. iconic behaviour honestly.
π«Ά THREAD SAFETY π«Ά
it is safe to call this function from any thread π go off, call it from wherever, she can handle it.
π AVAILABILITY π
this function is available since SDL 3.2.0 β¨ so if you're on something older, sorry bestie, you're out of luck π
lowkey reminder: it's Linux-flavoured. the name says Linux for a reason π§π
and that's the whole page, no crumbs left π
brought to you by the Simple Directmedia Layer girlies, version SDL 3.4.18, and this very SDL_SetLinuxThreadPriority(3) page π mwah, go set some priorities bestie π¦π
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms