sleef
sleef copied to clipboard
Add mutex in feature detection code
This implements a suggestion from @shibatch for #561. It uses a pthread mutex to prevent multiple threads from accessing the sigjmp variable in the feature detection code simultaneously.
Remaining todos:
- How to initialize the pthread mutex on MacOX and Windows? The code currently errors out on these platforms
- With older Glibc's I guess this requires sleef users to link against libpthread. Would that be acceptable? With newer Glibcs libpthread is part of libc already.
Apart from that the code fixes the problems in #561