1. the queue.poll() method in nextpacket() returns null 2. context switches happen and the queue gets 500 queue.put(packet) in sendPacket(packet) from different threads 3. the 501the queue.put(packet) blocks ( the size of the queue is 500) 4. nextpacket() continues and starts waiting on a notification 5. a notification never happens because all the following queue.put(packet) are blocked...
1. the queue.poll() method in nextpacket() returns null
2. context switches happen and the queue gets 500 queue.put(packet) in sendPacket(packet) from different threads
3. the 501the queue.put(packet) blocks ( the size of the queue is 500)
4. nextpacket() continues and starts waiting on a notification
5. a notification never happens because all the following queue.put(packet) are blocked...