Thread-specific is not sufficient. Different SoundSources may use memory-mapped files and even multiple instances of SoundSourceMp3 may exist simultaneously in the same thread.
The only thing we could do is print a generic error message and terminate the application immediately. We can't get hold of any information about the cause in the signal handler. Only the last invocation of sigaction()/sigsetjmp(() is effective, but this is not necessarily the same context where the failure actually occurred.
Thread-specific is not sufficient. Different SoundSources may use memory-mapped files and even multiple instances of SoundSourceMp3 may exist simultaneously in the same thread.
The only thing we could do is print a generic error message and terminate the application immediately. We can't get hold of any information about the cause in the signal handler. Only the last invocation of sigaction( )/sigsetjmp( () is effective, but this is not necessarily the same context where the failure actually occurred.