Commit c139dc6d authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Windows : Fix application verifier errors.

Make different threads that are running data_copy_thread_func()
use the same pthread_mutex for locking (not the copies of the same
pthread_mutex_t).
parent 0fa35ddf
......@@ -124,7 +124,7 @@ struct datadir_thread_ctxt_t {
datadir_iter_t *it;
uint n_thread;
uint *count;
pthread_mutex_t count_mutex;
pthread_mutex_t* count_mutex;
os_thread_id_t id;
bool ret;
};
......@@ -965,7 +965,7 @@ run_data_threads(datadir_iter_t *it, os_thread_func_t func, uint n)
data_threads[i].it = it;
data_threads[i].n_thread = i + 1;
data_threads[i].count = &count;
data_threads[i].count_mutex = count_mutex;
data_threads[i].count_mutex = &count_mutex;
os_thread_create(func, data_threads + i, &data_threads[i].id);
}
......@@ -2042,9 +2042,9 @@ decrypt_decompress_thread_func(void *arg)
datadir_node_free(&node);
pthread_mutex_lock(&ctxt->count_mutex);
pthread_mutex_lock(ctxt->count_mutex);
--(*ctxt->count);
pthread_mutex_unlock(&ctxt->count_mutex);
pthread_mutex_unlock(ctxt->count_mutex);
ctxt->ret = ret;
......
......@@ -696,7 +696,7 @@ typedef struct {
datafiles_iter_t *it;
uint num;
uint *count;
pthread_mutex_t count_mutex;
pthread_mutex_t* count_mutex;
os_thread_id_t id;
} data_thread_ctxt_t;
......@@ -2874,9 +2874,9 @@ data_copy_thread_func(
}
pthread_mutex_lock(&ctxt->count_mutex);
pthread_mutex_lock(ctxt->count_mutex);
(*ctxt->count)--;
pthread_mutex_unlock(&ctxt->count_mutex);
pthread_mutex_unlock(ctxt->count_mutex);
my_thread_end();
os_thread_exit();
......@@ -4338,7 +4338,7 @@ xtrabackup_backup_func()
data_threads[i].it = it;
data_threads[i].num = i+1;
data_threads[i].count = &count;
data_threads[i].count_mutex = count_mutex;
data_threads[i].count_mutex = &count_mutex;
os_thread_create(data_copy_thread_func, data_threads + i,
&data_threads[i].id);
}
......
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