Skip to content
Permalink
Browse files
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).
  • Loading branch information
vaintroub committed Sep 20, 2018
1 parent 0fa35dd commit c139dc6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
@@ -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);
}

0 comments on commit c139dc6

Please sign in to comment.