mirror of
https://github.com/openssl/openssl.git
synced 2024-11-27 12:04:38 +08:00
Some minor nit corrections in the thread code for rcu
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24630)
(cherry picked from commit d38d264228
)
This commit is contained in:
parent
fa49560451
commit
f7252d736d
@ -23,7 +23,8 @@ struct rcu_lock_st {
|
||||
struct rcu_cb_item *cb_items;
|
||||
};
|
||||
|
||||
CRYPTO_RCU_LOCK *ossl_rcu_lock_new(int num_writers, OSSL_LIB_CTX *ctx)
|
||||
CRYPTO_RCU_LOCK *ossl_rcu_lock_new(int num_writers,
|
||||
ossl_unused OSSL_LIB_CTX *ctx)
|
||||
{
|
||||
struct rcu_lock_st *lock;
|
||||
|
||||
|
@ -409,7 +409,9 @@ static void ossl_rcu_free_local_data(void *arg)
|
||||
OSSL_LIB_CTX *ctx = arg;
|
||||
CRYPTO_THREAD_LOCAL *lkey = ossl_lib_ctx_get_rcukey(ctx);
|
||||
struct rcu_thr_data *data = CRYPTO_THREAD_get_local(lkey);
|
||||
|
||||
OPENSSL_free(data);
|
||||
CRYPTO_THREAD_set_local(lkey, NULL);
|
||||
}
|
||||
|
||||
void ossl_rcu_read_lock(CRYPTO_RCU_LOCK *lock)
|
||||
|
@ -190,6 +190,7 @@ static void ossl_rcu_free_local_data(void *arg)
|
||||
CRYPTO_THREAD_LOCAL *lkey = ossl_lib_ctx_get_rcukey(ctx);
|
||||
struct rcu_thr_data *data = CRYPTO_THREAD_get_local(lkey);
|
||||
OPENSSL_free(data);
|
||||
CRYPTO_THREAD_set_local(lkey, NULL);
|
||||
}
|
||||
|
||||
void ossl_rcu_read_lock(CRYPTO_RCU_LOCK *lock)
|
||||
|
@ -436,7 +436,7 @@ static int _torture_rcu(void)
|
||||
rcu_torture_result = 1;
|
||||
|
||||
rcu_lock = ossl_rcu_lock_new(1, NULL);
|
||||
if (!rcu_lock)
|
||||
if (rcu_lock == NULL)
|
||||
goto out;
|
||||
|
||||
TEST_info("Staring rcu torture");
|
||||
|
Loading…
Reference in New Issue
Block a user