Disabled OS thread locking on OSes with PTHREAD due to closing problems with Mozilla

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1067 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
sth 2003-04-23 09:52:09 +00:00
parent 870efbf2c0
commit a9692c9c46
1 changed files with 14 additions and 0 deletions

View File

@ -413,6 +413,20 @@ sc_pkcs11_init_lock(CK_C_INITIALIZE_ARGS_PTR args)
*/
_locking = NULL;
if (args->flags & CKF_OS_LOCKING_OK) {
#ifdef HAVE_PTHREAD
/* FIXME:
* Mozilla uses the CKF_OS_LOCKING_OK flag. But the result
* is that the Mozilla process doesn't end when closing
* Mozilla, so you have to kill the process yourself.
* (If Mozilla would do a C_Finalize, the sc_pkcs11_free_lock()
* would be called and there wouldn't be a problem.)
* Therefore, we don't use the PTHREAD locking mechanisms, even
* if they are requested. This is the old situation which seems
* work fine for Mozilla, BUT will cause problems for apps
* that use multiple threads to access this lib simultaneously.
*/
return CKR_OK;
#endif
if (!(_lock = sc_mutex_new()))
rv = CKR_CANT_LOCK;
} else