]> git.sur5r.net Git - openldap/commit
ITS#7022 NSS_Init* functions are not thread safe
authorRich Megginson <rmeggins@redhat.com>
Tue, 16 Aug 2011 18:01:16 +0000 (12:01 -0600)
committerHoward Chu <hyc@openldap.org>
Wed, 24 Aug 2011 22:34:47 +0000 (15:34 -0700)
commita7aac14d2a0eeafc6972b39b367b2427928c4a4d
treeea05de999ee235a68c35ab2b893939d25f65cecf
parent3dae953fd6648f655c6bc67702fad4debbe59c40
ITS#7022 NSS_Init* functions are not thread safe

The NSS_InitContext et. al, and their corresponding shutdown functions,
are not thread safe.  There can only be one thread at a time calling
these functions.  Protect the calls with a mutex.  Create the mutex
using a PR_CallOnce to ensure that the mutex is only created once and
not used before created.  Move the registration of the nss shutdown
callback to also use a PR_CallOnce.  Removed the call to
SSL_ClearSessionCache() because it is always called at shutdown, and we must
not call it more than once.
libraries/libldap/tls_m.c