Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public string Get()
- {
- string current_variable = "";
- lock (locker)
- {
- current_variable = variable;
- Monitor.PulseAll(locker);
- }
- return current_variable;
- }
- public void Put(string i)
- {
- lock (locker)
- {
- while (variable.Count(x => x == 'A') < 3 && i != "A")
- {
- Monitor.Wait(locker);
- if (isDone == true)
- {
- return;
- }
- }
- variable = variable + i;
- Monitor.PulseAll(locker);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement