SDL_ThreadPriority(3type)

πŸ’– SDL_ThreadPriority πŸ’–

ok so bestie, welcome to the SDL3 DATATYPES corner of the manual β€” this one's about SDL_ThreadPriority, the enum that tells SDL how much of a main character your thread is. πŸ‘‘


✨ NAME ✨

SDL_ThreadPriority β€” literally just, the SDL thread priority. that's the whole vibe. πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_thread.h>

typedef enum SDL_ThreadPriority {
    SDL_THREAD_PRIORITY_LOW,
    SDL_THREAD_PRIORITY_NORMAL,
    SDL_THREAD_PRIORITY_HIGH,
    SDL_THREAD_PRIORITY_TIME_CRITICAL
} SDL_ThreadPriority;

so it's an enum, it lives in SDL_thread.h, and it has four whole moods. we love a four-mood icon. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

ok so here's the tea: SDL will make system changes as necessary in order to apply the thread priority. like, it's not just gonna sit there and politely ask β€” it'll actually go mess with system stuff to make it happen. πŸ”₯

which means!! if your code is out here trying to control thread state related to priority, you gotta be aware that calling SDL_SetCurrentThreadPriority may alter such state. no cap. it can lowkey change things under you. 😭

and if you wanna control aspects of this behavior? there's SDL_HINT_THREAD_PRIORITY_POLICY for that. use it, bestie, it's giving control freak in the best way. πŸŽ€


🌈 AVAILABILITY 🌈

This enum is available since SDL 3.2.0. she's not brand new but she's still fresh. 🫢


and that's the whole page, bestie!! slay. this one came to you courtesy of Simple Directmedia Layer, SDL 3.4.18, page SDL_ThreadPriority(3type) β€” tysm for reading, ily, go set some priorities responsibly πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from