示例#1
0
        private static int ThreadInterrupt(VThread thread)
        {
            if (thread.state == ThreadState.THREAD_RUNNING)
            {
                WaitForThreadSuspend(thread);

                if (thread.isMain)
                {
                    /*
                     * Shutdown all running threads
                     * and de-allocate al allocated
                     * memory. If we do not call join()
                     * to wait for all other threads
                     * regardless of what they are doing, we
                     * stop them.
                     */
                    ScorpionVM.Shutdown(true);
                }
                else
                {
                    try
                    {
                        thread.handle.Interrupt();
                    }
                    catch (Exception)
                    {
                        return(-1);
                    }
                }
            }

            return(-1);
        }
示例#2
0
        static void Main(string[] args)
        {
            string[] pOptions = null;

            if (args.Length == 0)
            {
                ConsoleHelper.Error("no input files!\nTry '{0}  -help' for more information.",
                                    Application.Constants.Name);
            }

            pOptions = ConsoleHelper.ProcessArgs(args);
            if (pOptions == null)
            {
                ConsoleHelper.Error("executable file not provided, see " +
                                    Application.Constants.Name + " -help for more details.");
            }

            if (!Application.Ready())
            {
                Application.Error("Application is not ready to start. Please make sure you" +
                                  "have installed " + Application.Constants.ProductNameShort + " correctly.");
            }

            Globals.Init();
            if (ExeLoader.Load(pOptions))
            {
                if (!ScorpionVM.Startup(pOptions))
                {
                    ConsoleHelper.Error("exe \"" + Globals.Exe.header.name + "\" failed to start.");
                }
            }

            ConsoleHelper.Error("executable file: \"" + pOptions[0] + "\" could not be loaded.");
        }