SDL_SignalAsyncIOQueue(3)

πŸ’– SDL_SignalAsyncIOQueue πŸ’–

okay bestie, welcome to the SDL_SignalAsyncIOQueue(3) page β€” a lil' function from the SDL3 FUNCTIONS fam that is genuinely the friend who texts "you up?" to wake everybody out of a nap 😭


✨ NAME ✨

SDL_SignalAsyncIOQueue β€” wake up any threads that are blocking in SDL_WaitAsyncIOResult().

like, it's giving alarm clock energy, no cap β°πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <SDL3/SDL_asyncio.h>

void SDL_SignalAsyncIOQueue(SDL_AsyncIOQueue *queue);

🌸 DESCRIPTION 🌸

So here's the vibe: this will unblock any threads that are sleeping in a call to SDL_WaitAsyncIOResult for the specified queue, and cause them to return from that function. literally waking them up mid-nap 🫢

It's highkey useful when you're destroying a queue and you need to make sure nothing is touching it indefinitely. In this case, once this call completes, the caller should take measures to make sure any previously-blocked threads have returned from their wait and will not touch the queue again β€” perhaps by setting a flag to tell the threads to terminate and then using SDL_WaitThread() to make sure they've done so. (yes bestie, the flag + SDL_WaitThread() combo is the main character move here πŸ‘‘)

⚠️ careful queen: after you signal, the threads might not have actually come back yet. Do the flag thing and the SDL_WaitThread() thing before you go touching that queue again, fr fr. πŸ’€

πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • queue β€” the async I/O task queue to signal. that's the one getting the wake-up call πŸ“žβœ¨

🧚 THREAD SAFETY 🧚

It is safe to call this function from any thread. periodt. πŸ’…


🌈 AVAILABILITY 🌈

This function is available since SDL 3.2.0. πŸ“


⭐ SEE ALSO ⭐


Simple Directmedia Layer Β· SDL 3.4.18 Β· SDL_SignalAsyncIOQueue(3)

okay that's the whole page bestie, go signal your queues and slay πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

πŸ“¦ where this page comes from