Город МОСКОВСКИЙ
00:10:46

Why should wait() always be called inside a loop?

Аватар
Java Prodigy: проявите свой талант
Просмотры:
22
Дата загрузки:
05.12.2023 06:46
Длительность:
00:10:46
Категория:
Обучение

Описание

A thread can also wake up without being notified, interrupted, or timing out, a so-called spurious wakeup. While this will rarely occur in practice, applications must guard against it by testing for the condition that should have caused the thread to be awakened, and continuing to wait if the condition is not satisfied. In other words,
waits should always occur in loops,
Below is the GitHub link to download source:
https://github.com/kishanjavatrainer/ProducerAndConsumerExample.git

Рекомендуемые видео