Changeset 44663


Ignore:
Timestamp:
Apr 21, 2008, 1:27:48 AM (10 years ago)
Author:
chris_kohlhoff
Message:

Ensure that timer dispatching responsibility is correctly relinquished when
processing leftover interrupts from a previous run invocation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/boost/asio/detail/win_iocp_io_service.hpp

    r43569 r44663  
    506506      else
    507507      {
     508        // Relinquish responsibility for dispatching timers. If the io_service
     509        // is not being stopped then the thread will get an opportunity to
     510        // reacquire timer responsibility on the next loop iteration.
     511        if (dispatching_timers)
     512        {
     513          ::InterlockedCompareExchange(&timer_thread_, 0, this_thread_id);
     514        }
     515
    508516        // The stopped_ flag is always checked to ensure that any leftover
    509517        // interrupts from a previous run invocation are ignored.
    510518        if (::InterlockedExchangeAdd(&stopped_, 0) != 0)
    511519        {
    512           // Relinquish responsibility for dispatching timers.
    513           if (dispatching_timers)
    514           {
    515             ::InterlockedCompareExchange(&timer_thread_, 0, this_thread_id);
    516           }
    517 
    518520          // Wake up next thread that is blocked on GetQueuedCompletionStatus.
    519521          if (!::PostQueuedCompletionStatus(iocp_.handle, 0, 0, 0))
Note: See TracChangeset for help on using the changeset viewer.