mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
Disable signal handling in threads (see issue #1042)
I don't necessarily like having to do these extra calls whenever threads are spawned (and what happens to signals during the time signal delivery is disabled?) but it seems to fully fix os.execute. NOTE: Also disables signals when loading openal, as it or one of its backends spawns threads internally, and does not disable signals itself. --HG-- branch : minor
This commit is contained in:
@@ -96,6 +96,11 @@ Audio::Audio()
|
||||
, poolThread(nullptr)
|
||||
, distanceModel(DISTANCE_INVERSE_CLAMPED)
|
||||
{
|
||||
#if defined(LOVE_LINUX)
|
||||
// Temporarly block signals, as the thread inherits this mask
|
||||
love::thread::disableSignals();
|
||||
#endif
|
||||
|
||||
// Passing null for default device.
|
||||
device = alcOpenDevice(nullptr);
|
||||
|
||||
@@ -116,6 +121,10 @@ Audio::Audio()
|
||||
if (!alcMakeContextCurrent(context) || alcGetError(device) != ALC_NO_ERROR)
|
||||
throw love::Exception("Could not make context current.");
|
||||
|
||||
#if defined(LOVE_LINUX)
|
||||
love::thread::reenableSignals();
|
||||
#endif
|
||||
|
||||
#ifdef ALC_EXT_EFX
|
||||
initializeEFX();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user