*/
static LHASH_OF(OBJ_NAME) *names_lh = NULL;
static int names_type_num = OBJ_NAME_TYPE_NUM;
-static CRYPTO_RWLOCK *lock = NULL;
+static CRYPTO_RWLOCK *obj_lock = NULL;
struct name_funcs_st {
unsigned long (*hash_func) (const char *name);
{
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
names_lh = lh_OBJ_NAME_new(obj_name_hash, obj_name_cmp);
- lock = CRYPTO_THREAD_lock_new();
+ obj_lock = CRYPTO_THREAD_lock_new();
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
- return names_lh != NULL && lock != NULL;
+ return names_lh != NULL && obj_lock != NULL;
}
int OBJ_NAME_init(void)
if (!OBJ_NAME_init())
return 0;
- CRYPTO_THREAD_write_lock(lock);
+ CRYPTO_THREAD_write_lock(obj_lock);
if (name_funcs_stack == NULL) {
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
name_funcs->free_func = free_func;
out:
- CRYPTO_THREAD_unlock(lock);
+ CRYPTO_THREAD_unlock(obj_lock);
return ret;
}
return NULL;
if (!OBJ_NAME_init())
return NULL;
- CRYPTO_THREAD_read_lock(lock);
+ CRYPTO_THREAD_read_lock(obj_lock);
alias = type & OBJ_NAME_ALIAS;
type &= ~OBJ_NAME_ALIAS;
}
}
- CRYPTO_THREAD_unlock(lock);
+ CRYPTO_THREAD_unlock(obj_lock);
return value;
}
int alias, ok = 0;
if (!OBJ_NAME_init())
- return 0;
+ return 0;
- CRYPTO_THREAD_write_lock(lock);
+ CRYPTO_THREAD_write_lock(obj_lock);
alias = type & OBJ_NAME_ALIAS;
type &= ~OBJ_NAME_ALIAS;
ok = 1;
unlock:
- CRYPTO_THREAD_unlock(lock);
+ CRYPTO_THREAD_unlock(obj_lock);
return ok;
}
if (!OBJ_NAME_init())
return 0;
- CRYPTO_THREAD_write_lock(lock);
+ CRYPTO_THREAD_write_lock(obj_lock);
type &= ~OBJ_NAME_ALIAS;
on.name = name;
ok = 1;
}
- CRYPTO_THREAD_unlock(lock);
+ CRYPTO_THREAD_unlock(obj_lock);
return ok;
}
if (type < 0) {
lh_OBJ_NAME_free(names_lh);
sk_NAME_FUNCS_pop_free(name_funcs_stack, name_funcs_free);
- CRYPTO_THREAD_lock_free(lock);
+ CRYPTO_THREAD_lock_free(obj_lock);
names_lh = NULL;
name_funcs_stack = NULL;
- lock = NULL;
+ obj_lock = NULL;
} else
lh_OBJ_NAME_set_down_load(names_lh, down_load);
}