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(); }
public override void handleBox(int i) { Box box = new Box(name, i); q.Put(name, box); }
public void Put(string producername, Box box) { Console.WriteLine(producername + ": puts " + box.Id); buffer[putpos] = box; putpos = (putpos + 1) % CONST.BUFLEN; count++; }