MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / sdlDispatch

Function sdlDispatch

platform/sdl/sdlcallback.cpp:51–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51U32 sdlDispatch(std::function<U32()> p) {
52 if (isMainthread()) {
53 return p();
54 }
55 SdlCallback* callback = allocSdlCallback();
56 callback->pfn = p;
57 {
58 BOXEDWINE_CRITICAL_SECTION_WITH_CONDITION(callback->cond);
59 SDL_PushEvent(&callback->sdlEvent);
60 BOXEDWINE_CONDITION_WAIT(callback->cond);
61 }
62 U32 result = callback->result;
63 callback->pfn = nullptr;
64 freeSdlCallback(callback);
65 return result;
66}
67
68#endif

Callers

nothing calls this directly

Calls 4

allocSdlCallbackFunction · 0.85
SDL_PushEventFunction · 0.85
freeSdlCallbackFunction · 0.85
isMainthreadFunction · 0.50

Tested by

no test coverage detected