From 40e068d50687edbf9b6d6633563151ab59369747 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Tue, 8 Mar 2016 16:44:34 +0000 Subject: Move engine library over to using the new thread API Remove usage of CRYPTO_LOCK_ENGINE Reviewed-by: Richard Levitte --- crypto/engine/eng_table.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'crypto/engine/eng_table.c') diff --git a/crypto/engine/eng_table.c b/crypto/engine/eng_table.c index 22390d2b4d..9648c0cb94 100644 --- a/crypto/engine/eng_table.c +++ b/crypto/engine/eng_table.c @@ -130,7 +130,7 @@ int engine_table_register(ENGINE_TABLE **table, ENGINE_CLEANUP_CB *cleanup, { int ret = 0, added = 0; ENGINE_PILE tmplate, *fnd; - CRYPTO_w_lock(CRYPTO_LOCK_ENGINE); + CRYPTO_THREAD_write_lock(global_engine_lock); if (!(*table)) added = 1; if (!int_table_check(table, 1)) @@ -179,7 +179,7 @@ int engine_table_register(ENGINE_TABLE **table, ENGINE_CLEANUP_CB *cleanup, } ret = 1; end: - CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE); + CRYPTO_THREAD_unlock(global_engine_lock); return ret; } @@ -201,10 +201,10 @@ IMPLEMENT_LHASH_DOALL_ARG(ENGINE_PILE, ENGINE); void engine_table_unregister(ENGINE_TABLE **table, ENGINE *e) { - CRYPTO_w_lock(CRYPTO_LOCK_ENGINE); + CRYPTO_THREAD_write_lock(global_engine_lock); if (int_table_check(table, 0)) lh_ENGINE_PILE_doall_ENGINE(&(*table)->piles, int_unregister_cb, e); - CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE); + CRYPTO_THREAD_unlock(global_engine_lock); } static void int_cleanup_cb_doall(ENGINE_PILE *p) @@ -219,13 +219,13 @@ static void int_cleanup_cb_doall(ENGINE_PILE *p) void engine_table_cleanup(ENGINE_TABLE **table) { - CRYPTO_w_lock(CRYPTO_LOCK_ENGINE); + CRYPTO_THREAD_write_lock(global_engine_lock); if (*table) { lh_ENGINE_PILE_doall(&(*table)->piles, int_cleanup_cb_doall); lh_ENGINE_PILE_free(&(*table)->piles); *table = NULL; } - CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE); + CRYPTO_THREAD_unlock(global_engine_lock); } /* return a functional reference for a given 'nid' */ @@ -248,7 +248,7 @@ ENGINE *engine_table_select_tmp(ENGINE_TABLE **table, int nid, const char *f, return NULL; } ERR_set_mark(); - CRYPTO_w_lock(CRYPTO_LOCK_ENGINE); + CRYPTO_THREAD_write_lock(global_engine_lock); /* * Check again inside the lock otherwise we could race against cleanup * operations. But don't worry about a fprintf(stderr). @@ -319,7 +319,7 @@ ENGINE *engine_table_select_tmp(ENGINE_TABLE **table, int nid, const char *f, fprintf(stderr, "engine_table_dbg: %s:%d, nid=%d, caching " "'no matching ENGINE'\n", f, l, nid); #endif - CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE); + CRYPTO_THREAD_unlock(global_engine_lock); /* * Whatever happened, any failed init()s are not failures in this * context, so clear our error state. -- cgit v1.2.3