public ExecuteItemLock(BasicReplBackend evaluator) { Monitor.Enter(evaluator._executeItemLocker); #if DEBUG Debug.Assert(evaluator._executeItemLockedThread == null); evaluator._executeItemLockedThread = Thread.CurrentThread; #endif _evaluator = evaluator; }
private void RunRepl(JSession jSession) { BasicReplBackend backendType = null; string backendError = null; if (null != this._cmdLine.Backend && !this._cmdLine.Backend.Equals("standard", StringComparison.OrdinalIgnoreCase)) { try { backendType = (BasicReplBackend)Activator.CreateInstance(Type.GetType(this._cmdLine.Backend), this, jSession); } catch (UnsupportedReplException ex) { backendError = ex.Reason; } catch (Exception ex) { backendError = ex.Message; } } if (null == backendType) { backendType = new BasicReplBackend(this, jSession); } using (backendType) { backendType.Connect(); if (this._cmdLine.EnableAttach) { backendType.InitDebugger(); } if (null != backendError) { System.Console.Error.WriteLine("Error using selected REPL back-end:"); System.Console.Error.WriteLine(backendError); System.Console.Error.WriteLine("Using standard backend instead."); } backendType.ExecutionLoop(); } }