summaryrefslogtreecommitdiffstats
path: root/contrib/timer-wheel/timer-wheel.c
diff options
context:
space:
mode:
authorVenky Shankar <vshankar@redhat.com>2015-06-02 21:49:13 +0530
committerVenky Shankar <vshankar@redhat.com>2015-06-02 20:24:27 -0700
commit9a314fa22667bf5afe56e63e73f4b0f50cd291f6 (patch)
treee6d809b7eb84e5d90a7bf7857ac08db77ceebfca /contrib/timer-wheel/timer-wheel.c
parent29d5bd5fc8a7b24865801de9f2e3f10d55af6e85 (diff)
contrib/timer-wheel: fix deadlock in del_timer()
commit eaf3bfa added mod_timers() and successfully screwed up del_timer() by incorrectly wrapping it within double lock blocks. del_timer() was included before the above commit for the sake of timer API completion, thankfully noone used it till now. Change-Id: I07a454a216cf09dbb84777a23630e74a1e7f2830 BUG: 1227449 Signed-off-by: Venky Shankar <vshankar@redhat.com> Reviewed-on: http://review.gluster.org/11050 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'contrib/timer-wheel/timer-wheel.c')
-rw-r--r--contrib/timer-wheel/timer-wheel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/timer-wheel/timer-wheel.c b/contrib/timer-wheel/timer-wheel.c
index df8bb31fe87..d9b2ccdc68a 100644
--- a/contrib/timer-wheel/timer-wheel.c
+++ b/contrib/timer-wheel/timer-wheel.c
@@ -225,7 +225,7 @@ void gf_tw_del_timer (struct tvec_base *base, struct gf_tw_timer_list *timer)
if (timer_pending (timer))
__gf_tw_detach_timer (timer);
}
- pthread_spin_lock (&base->lock);
+ pthread_spin_unlock (&base->lock);
}
int gf_tw_mod_timer_pending (struct tvec_base *base,