Exemplo n.º 1
0
        public int Run(string currentDirectory, Dictionary <string, string> environmentVariables, string[] args, bool shadowCache)
        {
            bool lockTaken = false;

            try
            {
                Monitor.TryEnter(runLock, ref lockTaken);
                if (!lockTaken)
                {
                    // Busy, exit right away
                    return(BusyReturnCode);
                }

                // Do your stuff...
                Console.WriteLine("Run Received {0}", string.Join(" ", args));

                upTime.Restart();

                var logger = OperationContext.Current.GetCallbackChannel <IServerLogger>();
                var result = shadowManager.Run(currentDirectory, environmentVariables, args, shadowCache, logger);
                return(result);
            }
            finally
            {
                if (lockTaken)
                {
                    Monitor.Exit(runLock);
                }
            }
        }
Exemplo n.º 2
0
        public int Run(string currentDirectory, string[] args)
        {
            Console.WriteLine("Run Received {0}", string.Join(" ", args));

            upTime.Restart();

            var logger = OperationContext.Current.GetCallbackChannel <IServerLogger>();
            var result = shadowManager.Run(currentDirectory, args, logger);

            return(result);
        }