LibuvSharp.Loop.RunGuard C# (CSharp) Method

RunGuard() private method

private RunGuard ( System.Action action ) : bool
action System.Action
return bool
        private bool RunGuard(Action action)
        {
            if (IsRunning) {
                return false;
            }

            // save the value, restore it aftwards
            var tmp = currentLoop;

            IsRunning = true;
            currentLoop = this;

            if (action != null) {
                action();
            }

            IsRunning = false;
            currentLoop = tmp;

            return true;
        }

Same methods

Loop::RunGuard ( System.Action context, Func func ) : bool