Skip to content

Commit fa91bfa

Browse files
authored
before the saints
Dare any of you, having a matter against another, go to law before the unjust, and not before the saints? (1Cor 6:1)
1 parent 8b1a6a1 commit fa91bfa

1 file changed

Lines changed: 14 additions & 21 deletions

File tree

Multithreading/task27/task2709/Solution.java

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11

22
//Dare any of you, having a matter against another, go to law before the unjust, and not before the saints? (1Cor 6:1)
33

4-
before the saints
5-
6-
Dare any of you, having a matter against another, go to law before the unjust, and not before the saints? (1Cor 6:1)
7-
4+
package com.javarush.task.task27.task2709;
85

6+
/*
7+
Producer–consumer
8+
*/
9+
public class Solution {
10+
public static void main(String args[]) throws InterruptedException {
11+
TransferObject transferObject = new TransferObject();
12+
ProducerTask producerTask = new ProducerTask(transferObject);
13+
ConsumerTask consumerTask = new ConsumerTask(transferObject);
914

15+
Thread.sleep(50);
16+
producerTask.stop();
17+
consumerTask.stop();
18+
}
19+
}
1020

1121
/*
1222
Producer–consumer
@@ -36,21 +46,4 @@
3646
4. Метод put класса TransferObject должен ждать пока value заберут и обновлять его значение после того, как оно пропадет.
3747
5. Метод get класса TransferObject должен устанавливать флаг isValuePresent в false и уведомлять другие нити ожидающие освобождения монитора перед возвратом значение поля value.
3848
6. Метод put класса TransferObject должен устанавливать флаг isValuePresent в true и уведомлять другие нити ожидающие освобождения монитора после обновления значение поля value.
39-
40-
package com.javarush.task.task27.task2709;
41-
42-
*
43-
Producer–consumer
44-
*
45-
public class Solution {
46-
public static void main(String args[]) throws InterruptedException {
47-
TransferObject transferObject = new TransferObject();
48-
ProducerTask producerTask = new ProducerTask(transferObject);
49-
ConsumerTask consumerTask = new ConsumerTask(transferObject);
50-
51-
Thread.sleep(50);
52-
producerTask.stop();
53-
consumerTask.stop();
54-
}
55-
}
5649
*/

0 commit comments

Comments
 (0)