summaryrefslogtreecommitdiffstats
path: root/crypto/engine/eng_table.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-03-08 17:44:34 +0100
committerRichard Levitte <levitte@openssl.org>2016-03-09 11:04:01 +0100
commit40e068d50687edbf9b6d6633563151ab59369747 (patch)
tree9e61b94dcf9cde655886a21123f8a13defef2a7b /crypto/engine/eng_table.c
parenterr_lcl.h is gone, don't pretend it's there (diff)
downloadopenssl-40e068d50687edbf9b6d6633563151ab59369747.tar.xz
openssl-40e068d50687edbf9b6d6633563151ab59369747.zip
Move engine library over to using the new thread API
Remove usage of CRYPTO_LOCK_ENGINE Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/engine/eng_table.c')
-rw-r--r--crypto/engine/eng_table.c16
1 files changed, 8 insertions, 8 deletions
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.