@space88man I can confirm, that fix is working for 5.8 branch with commit [cafe437](https://github.com/kamailio/kamailio/commit/cafe437dcb637b0e571a2d2ffd04d911...)
No deadlock with tls_threads_mode=2 and also no fail under TLS load for both modes.
Many thanks!
(As I was testing soon after you backported commit to 5.8, I really scratched my head why I cannot replicate the issue)