Make isc_task_pause/isc_task_unpause thread safe.
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
Showing with 47 additions and 29 deletions