void Release(ProgramExecuter program) { lock (lock_) { pool_.Enqueue(program); Monitor.Pulse(lock_); } }
static void Main(string[] args) { KeyCombinationConfigurationReader reader = new KeyCombinationConfigurationReader(); var keys = reader.GetListOfKeyStrokes(); ProgramExecuter executer = new ProgramExecuter(reader.GetKeyConfiguration().ProgramToExecute); KeyWatcher keyWatcher = new KeyWatcher(keys); keyWatcher.MagicSequencePressed += () => executer.ExecuteFile(); keyWatcher.InitializeLogging(); }
public IProgram GetProgram() { lock (lock_) { while (IsEmpty()) { Monitor.Wait(lock_); } ProgramExecuter program = pool_.Dequeue(); return(new ProgramImpl(program, () => Release(program))); } }
public GetUserInputTests() { _pe = new ProgramExecuter(); _cp = new CommandParser(); }