예제 #1
0
 public void Leave(AgentClass agent)
 {
     semaphore.Release();
     lock (agents)
     {
         agents.Remove(agent);
     }
 }
예제 #2
0
 public void Enter(AgentClass agent)
 {
     semaphore.WaitOne();
     lock (agents)
     {
         agents.Add(agent);
     }
 }