public async Task WriteAsync(string cad, InputOutputMutex action = InputOutputMutex.None) { if (action.IsWaitable()) { _mutex.WaitOne(); } await Output.WriteAsync(cad); if (action.IsReleasable()) { _mutex.ReleaseMutex(); } }
public void Write(string cad, InputOutputMutex action = InputOutputMutex.None) { if (action.IsWaitable()) { _mutex.WaitOne(); } Output.Write(cad); if (action.IsReleasable()) { _mutex.ReleaseMutex(); } }
public async Task <string> ReadLineAsync(InputOutputMutex action = InputOutputMutex.None) { if (action.IsWaitable()) { _mutex.WaitOne(); } var line = await Input.ReadLineAsync(); if (action.IsReleasable()) { _mutex.ReleaseMutex(); } return(line); }
public string ReadLine(InputOutputMutex action = InputOutputMutex.None) { if (action.IsWaitable()) { _mutex.WaitOne(); } var line = Input.ReadLine(); if (action.IsReleasable()) { _mutex.ReleaseMutex(); } return(line); }