A basic problem of Java concurrent programming

clipboard.png

, thread, thread.getName() Thread-0
Thread-0 main
thread.interrupted() main, thread

thread.interrupted? , main

clipboard.png

Jun.08,2022

what the book wants to say is that Thread.interrupted ()


interrupted () is a static method, which is static even when the object is called, and isInterrupted () is the object of the thread in which it is tested.


Thread.interrupted () is a static method that returns whether the current thread is interrupted. That is, the thread in which the method is called returns whether that thread is interrupted or not.

Menu