From: Tom Tromey Date: Tue, 13 Feb 2001 18:44:51 +0000 (+0000) Subject: re PR libgcj/1351 (_Jv_select -vs- Thread.interrupt) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1eba9d1f8f758f0626a8712d47b8a43eda387ee0;p=gcc.git re PR libgcj/1351 (_Jv_select -vs- Thread.interrupt) Fix for PR libgcj/1351: * posix.cc (_Jv_select): Throw InterruptedIOException if thread is interrupted. Include Thread.h and InterruptedIOException.h. From-SVN: r39639 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index f92645a6569..9201d268ffe 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,10 @@ +2001-02-13 Tom Tromey + + Fix for PR libgcj/1351: + * posix.cc (_Jv_select): Throw InterruptedIOException if thread is + interrupted. + Include Thread.h and InterruptedIOException.h. + 2001-02-13 Bryce McKinlay * java/io/BlockDataException.java: Removed. diff --git a/libjava/posix.cc b/libjava/posix.cc index d470a644da3..1f5b037f704 100644 --- a/libjava/posix.cc +++ b/libjava/posix.cc @@ -1,6 +1,6 @@ // posix.cc -- Helper functions for POSIX-flavored OSs. -/* Copyright (C) 2000 Free Software Foundation +/* Copyright (C) 2000, 2001 Free Software Foundation This file is part of libgcj. @@ -14,6 +14,10 @@ details. */ #include +#include +#include +#include + #if defined (ECOS) extern "C" unsigned long long _clock (void); #endif @@ -76,6 +80,10 @@ _Jv_select (int n, fd_set *readfds, fd_set *writefds, if (r != -1 || errno != EINTR) return r; + // Here we know we got EINTR. + if (java::lang::Thread::interrupted ()) + throw new java::io::InterruptedIOException (JvNewStringLatin1 ("select interrupted")); + struct timeval after; if (timeout) {