コード例 #1
0
 public final void WindUpTask() {
   _ncacheLog.CriticalInfo("DSAsyncUpdatesProcessor", "WindUp Task Started.");
   if (_updateQueue != null) {
     _ncacheLog.CriticalInfo(
         "DSAsyncUpdatesProcessor", "Update processor Queue Count: " + _updateQueue.getCount());
   }
   _shutdownStatusLatch.SetStatusBit(ShutDownStatus.SHUTDOWN_INPROGRESS, ShutDownStatus.NONE);
   synchronized (this) {
     com.alachisoft.tayzgrid.common.threading.Monitor.pulse(this);
   }
   _ncacheLog.CriticalInfo("DSAsyncUpdatesProcessor", "WindUp Task Ended.");
 }
コード例 #2
0
  /** Thread function, keeps running. */
  protected final void Run() {
    while (this._worker != null && !this._isDisposing) {
      WriteOperation operation = null;
      try {
        synchronized (this) {
          if (this._updateQueue.getCount() < 1) {
            if (_shutdownStatusLatch.IsAnyBitsSet(ShutDownStatus.SHUTDOWN_INPROGRESS)) {
              _shutdownStatusLatch.SetStatusBit(
                  ShutDownStatus.SHUTDOWN_COMPLETED, ShutDownStatus.SHUTDOWN_INPROGRESS);
              return;
            }
            com.alachisoft.tayzgrid.common.threading.Monitor.wait(this);
          }

          if (this._updateQueue.getCount() > 0) {
            operation = this._updateQueue.Dequeue();
          } else if (_updateQueue.getCount() == 0
              && _shutdownStatusLatch.IsAnyBitsSet(ShutDownStatus.SHUTDOWN_INPROGRESS)) {
            break;
          }
        }

        if (operation == null) {
          continue;
        }
        synchronized (_processMutex) {
          if (!_isDisposing) {
            if (_dsMgr != null) {
              _dsMgr.DSAsyncUpdateInCache(operation);
            }
          }
        }
      } catch (InterruptedException e) {
        break;
      } catch (Exception e) {
      }
    }
  }