Calling Thread.sleep() with *interrupted status* set?

The Java documentation is not clear on this point. What happens if you call interrupt on a Thread before it calls Thread.sleep():

        //interrupt reaches Thread here
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            return;
        }

Will the InterruptedException be thrown?

Please point to relevant documentation.

13
задан Roland 2 November 2017 в 07:00
поделиться