This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.time.Duration; | |
import java.util.List; | |
import java.util.concurrent.locks.ReentrantLock; | |
import java.util.stream.IntStream; | |
import java.util.stream.Stream; | |
/** | |
* Demonstrate potential for deadlock on a {@link ReentrantLock} when there is both a synchronized and | |
* non-synchronized path to that lock, which can allow a virtual thread to hold the lock, but | |
* other pinned waiters to consume all the available workers. |