diff options
author | shishir gowda <shishirng@gluster.com> | 2011-07-15 01:45:07 +0000 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-07-17 07:46:13 -0700 |
commit | f1b0e963976208cc93e69fc627a81a6f4ab1640b (patch) | |
tree | 35c362919f171af110f8ac68f982381fe6b771b1 /xlators | |
parent | 6e0af764e68e429a70693a81c4a7c7343dcf0839 (diff) |
io-threads: Initialize mutex and cond
Thanks to Emmanuel Dreyfus for sending out the fix.
Signed-off-by: shishir gowda <shishirng@gluster.com>
Signed-off-by: Anand Avati <avati@gluster.com>
BUG: 3170 (Uninitialized mutex and cond in io-threads)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3170
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/performance/io-threads/src/io-threads.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c index 09b240e8847..91bb75d92a6 100644 --- a/xlators/performance/io-threads/src/io-threads.c +++ b/xlators/performance/io-threads/src/io-threads.c @@ -2188,6 +2188,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; |