sleef icon indicating copy to clipboard operation
sleef copied to clipboard

Add mutex in feature detection code

Open Andreas-Krebbel opened this issue 7 months ago • 1 comments

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:

  1. How to initialize the pthread mutex on MacOX and Windows? The code currently errors out on these platforms
  2. 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

Andreas-Krebbel avatar Jul 18 '24 09:07 Andreas-Krebbel