From 2f5dceff715ebd1faf44a5191b52d46bf9ada2d1 Mon Sep 17 00:00:00 2001 From: Tal Shnaiderman Date: Mon, 25 Oct 2021 11:46:14 +0300 Subject: [PATCH] crypto/mlx5: replace mutex initializer Remove the usage of PTHREAD_MUTEX_INITIALIZER which is not supported in Windows and initialize priv_list_lock in RTE_INIT. Signed-off-by: Tal Shnaiderman Acked-by: Matan Azrad --- drivers/crypto/mlx5/mlx5_crypto.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/mlx5/mlx5_crypto.c b/drivers/crypto/mlx5/mlx5_crypto.c index f430d8cde0..6bebc83c39 100644 --- a/drivers/crypto/mlx5/mlx5_crypto.c +++ b/drivers/crypto/mlx5/mlx5_crypto.c @@ -4,6 +4,7 @@ #include #include +#include #include #include #include @@ -33,7 +34,7 @@ TAILQ_HEAD(mlx5_crypto_privs, mlx5_crypto_priv) mlx5_crypto_priv_list = TAILQ_HEAD_INITIALIZER(mlx5_crypto_priv_list); -static pthread_mutex_t priv_list_lock = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t priv_list_lock; int mlx5_crypto_logtype; @@ -967,6 +968,7 @@ static struct mlx5_class_driver mlx5_crypto_driver = { RTE_INIT(rte_mlx5_crypto_init) { + pthread_mutex_init(&priv_list_lock, NULL); mlx5_common_init(); if (mlx5_glue != NULL) mlx5_class_driver_register(&mlx5_crypto_driver); -- 2.39.5