Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added task4/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 15 additions & 1 deletion task4/src/main/java/TaskRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,21 @@ public TaskRunner(Object mutex, String msg, int cnt) {

@Override
public void run() {
//TODO sleep 500
synchronized (mutex) {
while (iter < 100) {
if ((iter % 3) == cnt) {
list.add(message);
iter++;
mutex.notifyAll();
} else {
try {
mutex.wait();
} catch (InterruptedException e) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

гуд

e.printStackTrace();
}
}
}
}
}

}