From 83db97a4671b72d23ead7e1cba17f18423aeae3f Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Sat, 20 Apr 2019 12:16:15 -0400 Subject: [PATCH] block signals in the pcm thread --- simpleaudio.d | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/simpleaudio.d b/simpleaudio.d index 91b7ac2..8b0b21d 100644 --- a/simpleaudio.d +++ b/simpleaudio.d @@ -198,6 +198,17 @@ import core.thread; final class AudioPcmOutThread : Thread { /// this() { + version(linux) { + // this thread has no business intercepting signals from the main thread, + // so gonna block a couple of them + import core.sys.posix.signal; + sigset_t sigset; + auto err = sigfillset(&sigset); + assert(!err); + err = sigprocmask(SIG_BLOCK, &sigset, null); + assert(!err); + } + super(&run); }