Duplicate :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
On Solaris Thread.interrupt both sets the interrupted flag of the thread and raises a signal via thr_kill. A Thread.sleep checks the interrupt status then perform a timed-poll relying on a signal to cancel the poll and return EINTR. However, there is a race such that we can have: Interrupting thread Target Thread --------------------------------------------------------------- check interrupt flag set interupt flag thr_kill <signal delivered> poll(ms) The signal is delivered before the poll() and so the "sleep" continues until the specified time elapses.
|