summaryrefslogtreecommitdiffstats
path: root/xlators/performance
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2011-07-15 01:22:51 +0000
committerAnand Avati <avati@gluster.com>2011-07-17 07:44:53 -0700
commitbf8e3a864eafe7eef5795cd134f6c0d5812a4f17 (patch)
treea6079549ca5b5aea3a3724e4cecd9b3fc502b070 /xlators/performance
parent1742383787355241d5aaa4b2bdd92d089ef2d508 (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/performance')
-rw-r--r--xlators/performance/io-threads/src/io-threads.c12
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 c88f812a4..e9dae3183 100644
--- a/xlators/performance/io-threads/src/io-threads.c
+++ b/xlators/performance/io-threads/src/io-threads.c
@@ -2183,6 +2183,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);
if (xlator_get_volopt_info (&this->volume_options, "thread-count",