UIerr(UI_F_UI_NEW_METHOD, ERR_R_MALLOC_FAILURE);
return NULL;
}
+
+ ret->lock = CRYPTO_THREAD_lock_new();
+ if (ret->lock == NULL) {
+ UIerr(UI_F_UI_NEW_METHOD, ERR_R_MALLOC_FAILURE);
+ OPENSSL_free(ret);
+ return NULL;
+ }
+
if (method == NULL)
ret->meth = UI_get_default_method();
else
return;
sk_UI_STRING_pop_free(ui->strings, free_string);
CRYPTO_free_ex_data(CRYPTO_EX_INDEX_UI, ui, &ui->ex_data);
+ CRYPTO_THREAD_lock_free(ui->lock);
OPENSSL_free(ui);
}
# define UI_FLAG_REDOABLE 0x0001
# define UI_FLAG_PRINT_ERRORS 0x0100
int flags;
+
+ CRYPTO_RWLOCK *lock;
};
#endif
/* Internal functions to open, handle and close a channel to the console. */
static int open_console(UI *ui)
{
- CRYPTO_w_lock(CRYPTO_LOCK_UI);
+ CRYPTO_THREAD_write_lock(ui->lock);
is_a_tty = 1;
#if defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE)
#ifdef OPENSSL_SYS_VMS
status = sys$dassgn(channel);
#endif
- CRYPTO_w_unlock(CRYPTO_LOCK_UI);
+ CRYPTO_THREAD_unlock(ui->lock);
return 1;
}
# define CRYPTO_LOCK_MALLOC2 27
# define CRYPTO_LOCK_DYNLOCK 29
# define CRYPTO_LOCK_ENGINE 30
-# define CRYPTO_LOCK_UI 31
# define CRYPTO_LOCK_ECDSA 32
# define CRYPTO_LOCK_ECDH 34
# define CRYPTO_LOCK_BN 35