aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2001-02-13 18:44:51 +0000
committerTom Tromey <tromey@gcc.gnu.org>2001-02-13 18:44:51 +0000
commit1eba9d1f8f758f0626a8712d47b8a43eda387ee0 (patch)
treee18a712ae4b86630ebac23b1b4cb7d026ee4526a /libjava
parentf4483e8502f0fa703045992a8bfbe9187a3206e5 (diff)
downloadgcc-1eba9d1f8f758f0626a8712d47b8a43eda387ee0.zip
gcc-1eba9d1f8f758f0626a8712d47b8a43eda387ee0.tar.gz
gcc-1eba9d1f8f758f0626a8712d47b8a43eda387ee0.tar.bz2
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
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog7
-rw-r--r--libjava/posix.cc10
2 files changed, 16 insertions, 1 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index f92645a..9201d26 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,10 @@
+2001-02-13 Tom Tromey <tromey@redhat.com>
+
+ 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 <bryce@albatross.co.nz>
* java/io/BlockDataException.java: Removed.
diff --git a/libjava/posix.cc b/libjava/posix.cc
index d470a64..1f5b037 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 <errno.h>
+#include <jvm.h>
+#include <java/lang/Thread.h>
+#include <java/io/InterruptedIOException.h>
+
#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)
{