public void Write(String cad, MutexAction action = MutexAction.NONE) { if (action == MutexAction.ADQUIRE || action == MutexAction.ATOMIC) { mutex.WaitOne(); } this.output.Write(cad); if (action == MutexAction.RELAX || action == MutexAction.ATOMIC) { mutex.ReleaseMutex(); } }
public String ReadLine(MutexAction action = MutexAction.NONE) { String cad; if (action == MutexAction.ADQUIRE || action == MutexAction.ATOMIC) { mutex.WaitOne(); } cad = this.input.ReadLine(); if (action == MutexAction.RELAX || action == MutexAction.ATOMIC) { mutex.ReleaseMutex(); } return(cad); }
public String ReadWord(MutexAction action = MutexAction.NONE) { if (ind < 0 || ind == words.Length) { ind = -1; line = this.ReadLine(action); words = line.Split(new char[1] { ' ' }, StringSplitOptions.RemoveEmptyEntries); } ind++; if (ind < words.Length) { return(words[ind]); } return(""); }
public void WriteLine(String cad, MutexAction action = MutexAction.NONE) { Write(cad + Types.newline, action); }