SDL_GetAsyncIOResult(3)
π SDL_GetAsyncIOResult(3) π
okay bestie so this is a page from the SDL3 FUNCTIONS manual, and today's main character is SDL_GetAsyncIOResult π¦
β¨ NAME β¨
SDL_GetAsyncIOResult β like, go ask your async I/O task queue if anything finished yet π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_asyncio.h>
bool SDL_GetAsyncIOResult(SDL_AsyncIOQueue *queue, SDL_AsyncIOOutcome *outcome);
π DESCRIPTION π
So here's the vibe: if a task assigned to this queue has finished, this function returns true and fills in outcome with all the deets of that task. If literally nothing in the queue has finished, it returns false. And it does not block β it's giving "I'm just checking, no pressure, no waiting around" π
If a task has completed, this function will free its resources and the task pointer will no longer be valid, bestie. Like, gone. Also, the task gets removed from the queue. So don't go holding onto that pointer afterwards, fr fr π
And the slayest part: it is safe for multiple threads to call this function on the same queue at once. A completed task will only go to one of the threads β no double-dipping, no drama, no chaos π
π FUNCTION PARAMETERS π
queueβ the async I/O task queue you're querying, like knocking on the door and being like "anyone done in there?" πͺoutcomeβ the details of a finished task get written here. It may not be NULL, so don't even try it π
β RETURN VALUE β
Returns true if a task has completed, and false otherwise. Simple. Iconic. Periodt. π
π THREAD SAFETY π
It is safe to call this function from any thread. Every single one. Go off. π§
π¦ AVAILABILITY π¦
This function has been available since SDL 3.2.0. Old enough to be trusted, young enough to be cute β¨
π SEE ALSO π
SDL_WaitAsyncIOResult(3)β for when you do wanna wait around π
ngl, the "may not be NULL" on outcome is not a suggestion, bestie. That's a whole warning. Respect it π«Ά
kisses, this was the Simple Directmedia Layer era of the docs, SDL 3.4.18 energy, and SDL_GetAsyncIOResult(3) said what it said πβ¨π
π¦ 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