3 ms·
Yeah, that's going to be a huge problem. Libraries shouldn't be doing that. They should leave signal handling to the caller and provide the functions that shoul
by matheusmoreira 6y ago
Yeah, that's going to be a huge problem. Libraries shouldn't be doing that. They should leave signal handling to the caller and provide the functions that should be called in those cases. Just like memory allocation, initialization...
- kstenerud 6y agoWhich is great in theory, except that signal handlers are such an esoteric body of knowledge that very few people can do it at all, let alone do it properly. So, many libraries do it for them (which works so long as nobody uses the blocking or blocking-dependent APIs - which is generally true). Even the JVM taps SIGQUIT for dumping process info.
- R0b0t1 6y agoThe workaround for this you can find in SDL2 and some other libraries with event loops is having a default, library-provided setup routine and event loop. Know what you're doing? Set up signals yourself. Don't? Library sets it up for you.