Implement the Runnable interface in the Pharmacy and Person classes.
All threads should run until isStopped is true.
Here's the logic for the Pharmacy class: drugController should make a random drug purchase (getRandomDrug) in a random amount (getRandomCount) and wait 300 ms.
Here's the logic for th
Pharmacy
- 18
Locked
Comments (5)
- Popular
- New
- Old
You must be signed in to leave a comment
matemate123
18 January, 10:36
Chillout task. It calm code whose give you pleasure when you read it (contradiction to code in task Restaurant)
0
Justin Smith
25 September 2021, 01:14
One of the most fun tasks so far. You can begin to see how games have things going on in the background without player interactivity, including random content.
0
Ivaylo Trifonov
9 August 2019, 15:31
First, it says: "All threads should run until isStopped is true."
And then in the conditions: "The Pharmacy thread should run as long as isStopped is false." and "The Person thread should run as long as isStopped is false.".
0
AR
18 April 2020, 16:05
They are not contradicting statements so i am not sure what your issue is ?
0
Roman Grygorczuk
1 March 2021, 20:16
I recommend to recall this lesson "Stopping threads: the official version"
0