On Fri, 20 Mar 2009, Julien R Pierre - Sun Microsystems wrote:

NSS team: Is PR_Init() thread-safe?

No, it is not thread-safe by definition, and must be called and completed before any other call to NSPR functions are made in any other thread. Typically, PR_Init is called in the primordial thread.

Thank you. I suspected this, but the docs page said nothing about it so I felt I better ask.

John, is that possibly the key to your problem? curl_global_init() is documented to be called first, it is documented not thread-safe and it calls PR_Init()... If curl_global_init() isn't called, libcurl will call it by itself on first use of another function but you're using threads so I would guess you get a bad race then and thus anything can happen!

--

 / daniel.haxx.se
--
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to