P
puzzlecracker
a.
let's say thread A calls wait or sleep during the execution, meanwhile
thread B calls ThreadA.interrupt();
does interrupt method blocks, waiting for A to finish wait/sleep and
then interrupting it? Does it asynchronouysly let jvm know to cancel
thread A upon the return, and those returns immediately?
b. does it make sense (is it allowed to pass runnable class with
synchronized method to Thread class or have one in subclass of Thread,
thereby letting start spawn the thread)to synchronize the run method.
If so, is it a good practice?
thanks
let's say thread A calls wait or sleep during the execution, meanwhile
thread B calls ThreadA.interrupt();
does interrupt method blocks, waiting for A to finish wait/sleep and
then interrupting it? Does it asynchronouysly let jvm know to cancel
thread A upon the return, and those returns immediately?
b. does it make sense (is it allowed to pass runnable class with
synchronized method to Thread class or have one in subclass of Thread,
thereby letting start spawn the thread)to synchronize the run method.
If so, is it a good practice?
thanks