private void RunScripts() {
     var runner = new ScriptRunner(_debug);
     while (_queue_scripts.Count != 0) {
         var script = _queue_scripts.Dequeue();
         try {
             runner.Execute(script, _procedure_pattern);
         } catch(Exception ex){
             runner.Results.Add(new ScriptError(script, null, ex.Message));
             StdInOut.LogScriptException(script, ex);
         }
     }
     lock (_list_results)
         _list_results.AddRange(runner.Results);
 }
 private void RunScripts() {
     using (var runner = new ScriptRunner(_debug)) {
         Script script;
         while (true) {
             lock(_queue_scripts){
                 if (_queue_scripts.Count == 0)
                     break;
                 script = _queue_scripts.Dequeue();
             }
             try {
                 runner.Execute(script, _procedure_pattern);
             } catch (Exception ex) {
                 runner.Results.Add(new ScriptError(script, null, ex.Message));
                 Logger.LogScriptException(script, ex);
             }
         }
         lock (_list_results) {
             _list_results.AddRange(runner.Results);
         }
     }
 }