Commit 7e477702 authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

refs #5507 more mutex initializers


git-svn-id: file:///svn/toku/tokudb@48059 c7de825b-a66e-492c-adef-691d508d4ae1
parent d9245a45
...@@ -218,6 +218,7 @@ compress_all_sub_blocks(int n_sub_blocks, struct sub_block sub_block[], char *un ...@@ -218,6 +218,7 @@ compress_all_sub_blocks(int n_sub_blocks, struct sub_block sub_block[], char *un
T = T - 1; // threads in addition to the running thread T = T - 1; // threads in addition to the running thread
struct workset ws; struct workset ws;
ZERO_STRUCT(ws);
workset_init(&ws); workset_init(&ws);
struct compress_work work[n_sub_blocks]; struct compress_work work[n_sub_blocks];
...@@ -317,6 +318,7 @@ decompress_all_sub_blocks(int n_sub_blocks, struct sub_block sub_block[], unsign ...@@ -317,6 +318,7 @@ decompress_all_sub_blocks(int n_sub_blocks, struct sub_block sub_block[], unsign
// init the decompression work set // init the decompression work set
struct workset ws; struct workset ws;
ZERO_STRUCT(ws);
workset_init(&ws); workset_init(&ws);
// initialize the decompression work and add to the work set // initialize the decompression work and add to the work set
......
...@@ -105,6 +105,7 @@ test_main (int argc, const char *argv[]) { ...@@ -105,6 +105,7 @@ test_main (int argc, const char *argv[]) {
struct my_threadpool my_threadpool; struct my_threadpool my_threadpool;
THREADPOOL threadpool; THREADPOOL threadpool;
ZERO_STRUCT(my_threadpool);
my_threadpool_init(&my_threadpool, max_threads); my_threadpool_init(&my_threadpool, max_threads);
threadpool = my_threadpool.threadpool; threadpool = my_threadpool.threadpool;
if (verbose) printf("test threadpool_set_busy\n"); if (verbose) printf("test threadpool_set_busy\n");
......
...@@ -115,11 +115,10 @@ toku_thread_run_internal(void *arg) { ...@@ -115,11 +115,10 @@ toku_thread_run_internal(void *arg) {
int int
toku_thread_pool_create(struct toku_thread_pool **pool_return, int max_threads) { toku_thread_pool_create(struct toku_thread_pool **pool_return, int max_threads) {
int r; int r;
struct toku_thread_pool *MALLOC(pool); struct toku_thread_pool *CALLOC(pool);
if (pool == NULL) { if (pool == NULL) {
r = get_error_errno(); r = get_error_errno();
} else { } else {
memset(pool, 0, sizeof *pool);
toku_mutex_init(&pool->lock, NULL); toku_mutex_init(&pool->lock, NULL);
toku_list_init(&pool->free_threads); toku_list_init(&pool->free_threads);
toku_list_init(&pool->all_threads); toku_list_init(&pool->all_threads);
......
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