BooEulerTool.TimeoutRunner.RunAction C# (CSharp) Method

RunAction() private static method

private static RunAction ( Action action, int timeout ) : Exception
action Action
timeout int
return System.Exception
        private static Exception RunAction(Action<string[]> action, int timeout)
        {
            Exception threadEx = null;
            var t = new Thread(() =>
            {
                try
                {
                    action(null);
                }
                catch (Exception e)
                {
                    threadEx = e;
                }
            });
            var timeoutEx = JoinWithTimeout(t, timeout);
            threadEx = timeoutEx ?? threadEx;
            return threadEx;
        }