Java 进阶:如何让线程主动让出 CPU
Thread.sleep
sleep 方法可以让线程主动让出 CPU,但是并不会释放锁。
/**
* Causes the currently executing thread to sleep (temporarily cease
* execution) for the specified number of milliseconds, subject to
* the precision and accuracy of system timers and schedulers. The thread