src/Azos.Wave/WorkContext.cs
/// <summary>
/// Releases work semaphore that throttles the processing of WorkContext instances.
/// The WorkContext is released automatically in destructor, however there are cases when the semaphore release
/// may be needed sooner, i.e. in a HTTP streaming application where work context instances are kept open indefinitely
/// it may not be desirable to consider long-living work context instances as a throttling factor.
/// Returns true if semaphore was released, false if it was not released during this call as it was already released before
/// </summary>
Releases work semaphore that throttles the processing of WorkContext instances.
The WorkContext is released automatically in destructor, however there are cases when the semaphore release
may be needed sooner, i.e. in a HTTP streaming application where work context instances are kept open indefinitely
it may not be desirable to consider long-living work context instances as a throttling factor.
Returns true if semaphore was released, false if it was not released during this call as it was already released before
Releases work semaphore that throttles the processing of WorkContext instances . The WorkContext is released automatically in destructor however there are cases when the semaphore release may be needed sooner i . e . in a HTTP streaming application where work context instances are kept open indefinitely it may not be desirable to consider long - living work context instances as a throttling factor . Returns true if semaphore was released false if it was not released during this call as it was already released before
public bool ReleaseWorkSemaphore()
      {
        if (m_Server!=null && m_Server.Running && !m_WorkSemaphoreReleased)
        {
          var workCount = m_Server.m_WorkSemaphore.Release();
          m_WorkSemaphoreReleased = true;
          if (m_Server.m_InstrumentationEnabled)
          {
            Interlocked.Increment(ref m_Server.m_stat_WorkContextWorkSemaphoreRelease);
            Thread.VolatileWrite(ref m_Server.m_stat_ServerWorkSemaphoreCount, workCount);
          }
          return true;
        }
        return false;
      }
public bool ReleaseWorkSemaphore ( ) { if ( m_Server != null && m_Server . Running && ! m_WorkSemaphoreReleased ) { var workCount = m_Server . m_WorkSemaphore . Release ( ) ; m_WorkSemaphoreReleased = true ; if ( m_Server . m_InstrumentationEnabled ) { Interlocked . Increment ( ref m_Server . m_stat_WorkContextWorkSemaphoreRelease ) ; Thread . VolatileWrite ( ref m_Server . m_stat_ServerWorkSemaphoreCount , workCount ) ; } return true ; } return false ; }
Releases work semaphore that throttles the processing of WorkContext instances.
Releases work semaphore that throttles the processing of WorkContext instances .