The prior change, while permitting the recette to pass, was incorrect. This was pointed out by Andreas Franke in a private communication. The current changes correct that error and also take into account differences in pthread behavior betwee the jvm and c backends, namely all mutexes owned by a thread are closed by thread exit in the jvm backend. See bglpthread::run in Java/bglpthread.java.
This PR is not fully compatible with the last modifications I have applied (it breaks SRFI18 and FTHREAD). However, I will accept it and back port the last changes.
The prior change, while permitting the recette to pass, was incorrect. This was pointed out by Andreas Franke in a private communication. The current changes correct that error and also take into account differences in pthread behavior betwee the jvm and c backends, namely all mutexes owned by a thread are closed by thread exit in the jvm backend. See bglpthread::run in Java/bglpthread.java.