Commit a6b90f19 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:4288], fix performance issue in unlock_worker_op in stress tests

git-svn-id: file:///svn/toku/tokudb@39608 c7de825b-a66e-492c-adef-691d508d4ae1
parent 2c07ae33
...@@ -121,15 +121,17 @@ static void lock_worker_op(struct worker_extra* we) { ...@@ -121,15 +121,17 @@ static void lock_worker_op(struct worker_extra* we) {
static void unlock_worker_op(struct worker_extra* we) { static void unlock_worker_op(struct worker_extra* we) {
ARG arg = we->thread_arg; ARG arg = we->thread_arg;
if (arg->lock_type != STRESS_LOCK_NONE) {
toku_pthread_mutex_lock(we->operation_lock_mutex); toku_pthread_mutex_lock(we->operation_lock_mutex);
if (arg->lock_type == STRESS_LOCK_SHARED) { if (arg->lock_type == STRESS_LOCK_SHARED) {
rwlock_read_unlock(we->operation_lock); rwlock_read_unlock(we->operation_lock);
} else if (arg->lock_type == STRESS_LOCK_EXCL) { } else if (arg->lock_type == STRESS_LOCK_EXCL) {
rwlock_write_unlock(we->operation_lock); rwlock_write_unlock(we->operation_lock);
} else { } else {
assert(arg->lock_type == STRESS_LOCK_NONE); assert(false);
} }
toku_pthread_mutex_unlock(we->operation_lock_mutex); toku_pthread_mutex_unlock(we->operation_lock_mutex);
}
} }
static void *worker(void *arg_v) { static void *worker(void *arg_v) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment