diff options
author | membar <membar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-12-16 22:54:22 +0000 |
---|---|---|
committer | membar <membar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-12-16 22:54:22 +0000 |
commit | 4d5772a7a4db67e0a2b6e387cbed908344dc9031 (patch) | |
tree | b5989fc00b6fe0bbc2e88ddede32688185e6203f /libjava/win32.cc | |
parent | 6d249aa72f8b5d9a218bb662ac6d9a2a41938d56 (diff) | |
download | gcc-4d5772a7a4db67e0a2b6e387cbed908344dc9031.tar.gz |
* win32.cc (WSAEventWrapper): Implemented default
constructor and init() methods.
(_Jv_select): Removed.
* gnu/java/nio/natSelectorImplWin32.cc
(helper_put_filedescriptors): Removed.
(helper_get_filedescriptors): Removed.
(implSelect): Implemented in terms of WSAEventWrapper
and WSAWaitForMultipleEvents instead of _Jv_select().
Added support for thread interruption.
* include/win32.h (WSAEventWrapper): Minor formatting
changes; added default constructor declaration, init(),
getFD() and getEventHandle() methods.
(_Jv_select): Removed.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74715 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/win32.cc')
-rw-r--r-- | libjava/win32.cc | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/libjava/win32.cc b/libjava/win32.cc index ec089a52bd8..027333be738 100644 --- a/libjava/win32.cc +++ b/libjava/win32.cc @@ -143,11 +143,24 @@ _Jv_Win32TempString::~_Jv_Win32TempString() } // class WSAEventWrapper +WSAEventWrapper::WSAEventWrapper (): + m_hEvent(0), + m_fd(0), + m_dwSelFlags(0) +{} + WSAEventWrapper::WSAEventWrapper (int fd, DWORD dwSelFlags): m_hEvent(0), - m_fd(fd), - m_dwSelFlags(dwSelFlags) + m_fd(0), + m_dwSelFlags(0) +{ + init(fd, dwSelFlags); +} + +void WSAEventWrapper::init(int fd, DWORD dwSelFlags) { + m_fd = fd; + m_dwSelFlags = dwSelFlags; m_hEvent = WSACreateEvent (); if (dwSelFlags) WSAEventSelect(fd, m_hEvent, dwSelFlags); @@ -446,19 +459,6 @@ backtrace (void **__array, int __size) } int -_Jv_select (int n, fd_set *readfds, fd_set *writefds, - fd_set *exceptfds, struct timeval *timeout) -{ - int r = ::select (n, readfds, writefds, exceptfds, timeout); - if (r == SOCKET_ERROR) - { - DWORD dwErrorCode = WSAGetLastError (); - throw new java::io::IOException (_Jv_WinStrError (dwErrorCode)); - } - return r; -} - -int _Jv_pipe (int filedes[2]) { return _pipe (filedes, 4096, _O_BINARY); |