This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Unblocking blocked I/O


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]