public void Start() { StopProcessing = false; cgGate.Close(); cgExecutingThread = new Thread(ThreadProc); cgExecutingThread.Name = "Screenshot Provider"; cgExecutingThread.Start(); }
/// <summary> /// Closes the gate and updates return value on failure /// </summary> /// <param name="gate">Gate to close</param> /// <param name="returnValue">Return value</param> /// <returns>True if closed successfully</returns> private bool CloseGate(IGate <T> gate, ref T returnValue) { T value = gate.Close(); if (!IsSuccess(value)) { // Makes sure return value has the last occured failure returnValue = value; LogHelper.LogError("Failed to close gate '{0}'", gate.GetType().Name); return(false); } return(true); }