public IMultiThreadExecutor AddOperation(MultiThreadExecutorOperation operation) { this.operationQueue.Enqueue(operation); // Signal that operation added in to the queue. this.simultaneouslyRunningLimit.Set(); lock (this.operationLoopSync) { if (this.operationQueue.Count == 1 && this.start && !this.operationLoop) { this.Start(true); } } return(this); }
public OperationInWorkState(MultiThreadExecutorOperation operation, Thread workThread) { this.operation = operation; this.workThread = workThread; }