September 2019
Intermediate to advanced
816 pages
18h 47m
English
When a thread is trying to execute I/O tasks or synchronized blocks, it may enter into the BLOCKED state. For example, if a thread, t1, tries to enter into a synchronized block of code that is already being accessed by another thread, t2, then t1 is kept in the BLOCKED state until it can acquire the lock.
This scenario is shaped in the following snippet of code: