This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Unblocking blocked I/O
- To: <java at gcc dot gnu dot org>
- Subject: Unblocking blocked I/O
- From: David Vrabel <dv207 at hermes dot cam dot ac dot uk>
- Date: Tue, 18 Sep 2001 09:32:41 +0100 (BST)
Hi,
I have a thread which blocks while reading from a network Socket. I need
to unblock the thread so it can see it's supposed to die (and then die
gracefully).
A search of the internet suggests that I can close the Socket (from
another thread) and then the blocked read will throw an exception (and
hence become unblocked). This does not work. The thread remains blocked
on the read.
I also tried Thread.interrupt() but that seemed completely broken.
Thanks.
David Vrabel