Skip to content

Commit 0ffeaa7

Browse files
authored
Update Processor.java
1 parent 2dac69b commit 0ffeaa7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

JavaMultiThreadingCodes/src/WaitAndNotify_8/Processor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public void consume() throws InterruptedException {
6161
scanner.nextLine();
6262
System.out.println("Return key pressed.");
6363
notify();
64-
Thread.sleep(5000);
64+
Thread.sleep(5000); // this is to demonstrate that notify does not lose control of lock like wait()
6565
System.out.println("Consumption done.");
6666
}
6767
}

0 commit comments

Comments
 (0)