Example #1
0
 public void Put(string producername, Box box)
 {
     _canAdd.WaitOne();
     _thisLock.WaitOne();
     Console.WriteLine(producername + ": puts " + box.Id);
     buffer[putpos] = box;
     putpos = (putpos + 1) % CONST.BUFLEN;
     count++;
     _thisLock.Release();
     _canGet.Release();
 }
Example #2
0
 public override void handleBox(int i)
 {
     Box box = new Box(name, i);
     q.Put(name, box);
 }
Example #3
0
 public void Put(string producername, Box box)
 {
     Console.WriteLine(producername + ": puts " + box.Id);
     buffer[putpos] = box;
     putpos = (putpos + 1) % CONST.BUFLEN;
     count++;
 }