|
@@ -37,6 +37,7 @@ public class ThreadSafeQueue<T> {
|
|
|
while (queue.size() == maxSize) {
|
|
|
notFull.await();
|
|
|
}
|
|
|
+System.out.println("进入队列");
|
|
|
queue.add(item);
|
|
|
notEmpty.signalAll();
|
|
|
} finally {
|
|
@@ -50,6 +51,7 @@ public class ThreadSafeQueue<T> {
|
|
|
while (queue.isEmpty()) {
|
|
|
notEmpty.await();
|
|
|
}
|
|
|
+ System.out.println("出队列");
|
|
|
T item = queue.remove();
|
|
|
notFull.signalAll();
|
|
|
return item;
|