SE450: Producer Thread [18/36] Previous pageContentsNext page

int i = 1; 
while (i <= greetingCount)
{
if (!queue.isFull())
{
queue.add(i + ": " + greeting);
i++;
}
Thread.sleep((int)(Math.random() * DELAY));
}

Previous pageContentsNext page