diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-02-13 18:44:51 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-02-13 18:44:51 +0000 |
commit | 7df0cd96aa8990365c8e32b40091fe7a637d670f (patch) | |
tree | e18a712ae4b86630ebac23b1b4cb7d026ee4526a /libjava/posix.cc | |
parent | 65e89c887375bdc10df6b73704d4eb14da01efc2 (diff) | |
download | gcc-7df0cd96aa8990365c8e32b40091fe7a637d670f.tar.gz |
Fix for PR libgcj/1351:
* posix.cc (_Jv_select): Throw InterruptedIOException if thread is
interrupted.
Include Thread.h and InterruptedIOException.h.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39639 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/posix.cc')
-rw-r--r-- | libjava/posix.cc | 10 |
1 files changed, 9 insertions, 1 deletions
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 <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) { |