From aa2b53171ea8f786052cbe40fee2bb43f081e3e9 Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Fri, 15 Jul 2011 01:34:26 +0000 Subject: io-threads: Initialize mutex and cond Thanks to Emmanuel Dreyfus for sending out the fix. Signed-off-by: shishir gowda Signed-off-by: Anand Avati BUG: 3170 (Uninitialized mutex and cond in io-threads) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3170 --- xlators/performance/io-threads/src/io-threads.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c index bdc808319d1..5e3d38f570d 100644 --- a/xlators/performance/io-threads/src/io-threads.c +++ b/xlators/performance/io-threads/src/io-threads.c @@ -2182,6 +2182,18 @@ init (xlator_t *this) goto out; } + if ((ret = pthread_cond_init(&conf->cond, NULL)) != 0) { + gf_log (this->name, GF_LOG_ERROR, + "pthread_cond_init failed (%d)", ret); + goto out; + } + + if ((ret = pthread_mutex_init(&conf->mutex, NULL)) != 0) { + gf_log (this->name, GF_LOG_ERROR, + "pthread_mutex_init failed (%d)", ret); + goto out; + } + set_stack_size (conf); thread_count = IOT_DEFAULT_THREADS; -- cgit