Skip to content
  • Witold Kręcicki's avatar
    Make isc_task_pause/isc_task_unpause thread safe. · 70c463a6
    Witold Kręcicki authored
    isc_task_pause/unpause were inherently thread-unsafe - a task
    could be paused only once by one thread, if the task was running
    while we paused it it led to races. Fix it by making sure that
    the task will pause if requested to, and by using a 'pause reference
    counter' to count task pause requests - a task will be unpaused
    iff all threads unpause it.
    
    Don't remove from queue when pausing task - we lock the queue lock
    (expensive), while it's unlikely that the task will be running -
    and we'll remove it anyway in dispatcher
    70c463a6