Make a constant for the park signal in case we want to change it

This commit is contained in:
John Lorentzson 2025-04-06 23:48:40 +02:00
parent e3ce9ae828
commit 8d840d89ea

View file

@ -17,6 +17,7 @@
#include <sys/audioio.h>
#include <pthread.h>
static const int parkSignal = SIGUSR1;
static pthread_t mainThread;
static int sndfp;
static void (*parent_callback)(long *stream, size_t frames_total);
@ -46,7 +47,7 @@ static void* soundcheckthread(void*) {
// park the main thread since the game probably expects it to not be
// doing anything else while we're requesting audio frames.
audioDone = false;
pthread_kill(mainThread, SIGUSR1);
pthread_kill(mainThread, parkSignal);
parent_callback(mix, 0x400 * 2);
@ -80,7 +81,7 @@ unsigned long SoftwareMixerBackend_Init(void (*callback)(long *stream, size_t fr
audioInfo.port = AUDIO_SPEAKER;
ioctl(sndfp, AUDIO_SETINFO, &audioInfo);
if(signal(SIGUSR1, threadPark) == SIG_ERR) {
if(signal(parkSignal, threadPark) == SIG_ERR) {
Backend_PrintError("Failed to register thread park signal handler for audio system.\n");
return 0;
}