diff options
| -rw-r--r-- | contrib/timer-wheel/timer-wheel.c | 9 | 
1 files changed, 8 insertions, 1 deletions
diff --git a/contrib/timer-wheel/timer-wheel.c b/contrib/timer-wheel/timer-wheel.c index cfbd74e166f..58e0607bf0c 100644 --- a/contrib/timer-wheel/timer-wheel.c +++ b/contrib/timer-wheel/timer-wheel.c @@ -159,7 +159,14 @@ run_timers (struct tvec_base *base)                          data = timer->data;                          __gf_tw_detach_timer (timer); -                        fn (timer, data, call_time); +                        pthread_spin_unlock(&base->lock); +                        { +                            /* It is required to run the actual function outside +                               of the locked zone, so we don't bother about +                               locked operations inside that function */ +                            fn(timer, data, call_time); +                        } +                        pthread_spin_lock(&base->lock);                  }          }          pthread_spin_unlock (&base->lock);  | 
