On Thu, Aug 29, 2013 at 12:00:12PM +0200, Paolo Bonzini wrote:
> Il 27/08/2013 10:23, Stefan Hajnoczi ha scritto:
> >  /* modify the current timer so that it will be fired when current_time
> >     >= expire_time. The corresponding callback will be called. */
> >  void timer_mod_ns(QEMUTimer *ts, int64_t expire_time)
> >  {
> > +    QEMUTimerList *timer_list = ts->timer_list;
> >      QEMUTimer **pt, *t;
> >  
> >      timer_del(ts);
> >  
> >      /* add the timer in the sorted list */
> > -    pt = &ts->timer_list->active_timers;
> > +    qemu_mutex_lock(&timer_list->active_timers_lock);
> > +    pt = &timer_list->active_timers;
> 
> I think deletion and modification of the list should happen without
> releasing the lock in the middle.

Thanks for explaining the race between two timer_mod_ns() calls to me on
IRC.  I have sent a new revision of this series with your fixes included.

Stefan

Reply via email to