diff options
author | Kotresh HR <khiremat@redhat.com> | 2015-03-31 20:13:59 +0530 |
---|---|---|
committer | Venky Shankar <vshankar@redhat.com> | 2015-04-03 03:30:23 -0700 |
commit | 00d4125a5cb7102efeb23873cbaf155a71faa9dd (patch) | |
tree | f8c34886cba49370d674bd0f995b4b6ab3dc9ed5 /xlators/features/changelog/lib/src/gf-changelog-journal-handler.c | |
parent | 614dbff79f7003382c239c5c75c48e78ce5397f5 (diff) |
libgfchangelog: Use correct 'this' pointer on new thread creation
When libgfchangelog is linked with non xlator application,
it should point to 'master' xlator which is initiated separately.
When ever a new thread is created, 'THIS' points to the global
xlator. 'THIS' should point to corresponding xlator even then.
This patch adjusts the pointer accordingly.
Change-Id: I2a199bb3c73146a0329540aedcbae697a00f6f0a
BUG: 1207643
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/10074
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Tested-by: Venky Shankar <vshankar@redhat.com>
Diffstat (limited to 'xlators/features/changelog/lib/src/gf-changelog-journal-handler.c')
-rw-r--r-- | xlators/features/changelog/lib/src/gf-changelog-journal-handler.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/xlators/features/changelog/lib/src/gf-changelog-journal-handler.c b/xlators/features/changelog/lib/src/gf-changelog-journal-handler.c index 65ee9555514..538a7faff68 100644 --- a/xlators/features/changelog/lib/src/gf-changelog-journal-handler.c +++ b/xlators/features/changelog/lib/src/gf-changelog-journal-handler.c @@ -583,10 +583,10 @@ gf_changelog_process (void *data) gf_changelog_entry_t *entry = NULL; gf_changelog_processor_t *jnl_proc = NULL; - this = THIS; - jnl = data; jnl_proc = jnl->jnl_proc; + THIS = jnl->this; + this = jnl->this; while (1) { pthread_mutex_lock (&jnl_proc->lock); @@ -961,6 +961,7 @@ gf_changelog_journal_init (void *xl, struct gf_brick_spec *brick) goto cleanup_fds; /* initialize journal processor */ + jnl->this = this; ret = gf_changelog_init_processor (jnl); if (ret) goto cleanup_fds; |