https://gitlab.synchro.net/main/sbbs/-/commit/3ccf90eda0d43776acde7f9f
Modified Files:
src/doors/termgfx/audio_mgr.c
Log Message:
termgfx: make async music transcode portable via threadwrap/semwrap
The worker that renders music (MIDI/MUS -> PCM -> OGG -> C;S upload APC)
off the game thread was POSIX-only. Move it onto xpdev's cross-platform wrappers so it works in Windows builds too:
- mutex + thread create: threadwrap (pthread_mutex_* -- native pthreads
on *nix, Win32 critical sections on Windows; _beginthread)
- worker wake: a semwrap semaphore (native POSIX sem / Win32 HANDLE)
in place of the pthread condvar
- shutdown "join": _beginthread makes a detached thread on every
platform (no joinable handle), so termgfx_audio_destroy() posts the
wake semaphore and waits on a worker-set exit flag rather than
pthread_join (which threadwrap lacks)
TERMGFX_ASYNC_MUSIC is now always on; the sync fallback remains behind
the macro for debugging. No behavior change on *nix -- validated end to
end (create -> submit real SMF -> poll SHIPPED -> destroy joins cleanly;
idle create/destroy clean) and both doors build clean under GCC -Werror.
The Windows leg uses the same wrappers the rest of Synchronet relies on
but is unverified by an MSVC compile here.
Co-Authored-By: Claude Opus 4.8 <
noreply@anthropic.com>
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net