public void put(Object o)
{
Monitor.Enter(this);
try
{
Bucket b = new Bucket(o);
if (tail != null)
{
tail.setNext(b);
tail = b;
}
else
{
// queue was empty but has one element now
head = tail = b;
}
count++;
// notify any waiting tasks
Monitor.Pulse(this);
}
finally
{
Monitor.Exit(this);
}
}