lundi 13 février 2017

Which code can swallow interruptedException?

Vote count: 0

I read concurency in practice. Now I want to understand how to handle InterrruptedException

Advices from book:

- Propagate the exception (possibly after some task-specific cleanup), making your method an interruptible blocking method, too; or
- Restore the interruption status so that code higher up on the call stack can deal with it.
- Only code that implements a thread's interruption policy may swallow an interruption request. General-purpose task and library code should never swallow interruption requests.

First two statements are clear for me but I don't understand third. Can you clarify this? Providing example will be prefered.

asked 18 secs ago

Let's block ads! (Why?)



Which code can swallow interruptedException?

Aucun commentaire:

Enregistrer un commentaire