aboutsummaryrefslogtreecommitdiff
path: root/libjava/include/win32.h
diff options
context:
space:
mode:
authorMohan Embar <gnustuff@thisiscool.com>2003-12-16 22:54:22 +0000
committerMohan Embar <membar@gcc.gnu.org>2003-12-16 22:54:22 +0000
commit5cd4d463f974cced4d9819ace4583641ec0ad188 (patch)
treeb5989fc00b6fe0bbc2e88ddede32688185e6203f /libjava/include/win32.h
parent027e655b6eb26b1a17355c0ad4d97baf9d418a30 (diff)
win32.cc (WSAEventWrapper): Implemented default constructor and init() methods.
* 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. From-SVN: r74715
Diffstat (limited to 'libjava/include/win32.h')
-rw-r--r--libjava/include/win32.h38
1 files changed, 24 insertions, 14 deletions
diff --git a/libjava/include/win32.h b/libjava/include/win32.h
index 3de6f11b9ef..8dd2964e637 100644
--- a/libjava/include/win32.h
+++ b/libjava/include/win32.h
@@ -93,25 +93,36 @@ extern jstring _Jv_Win32NewString (LPCTSTR pcsz);
/* Useful helper classes and methods. */
/* A C++ wrapper around a WSAEVENT which closes the event
- in its destructor. If dwSelFlags is non-zero, we also
- issue an WSAEventSelect on the socket descriptor with
- the given flags; this is undone by a corresponding call
- to WSAEventSelect(fd, 0, 0) in our destructor. */
+ in its destructor. If dwSelFlags is non-zero, we also
+ issue an WSAEventSelect on the socket descriptor with
+ the given flags; this is undone by a corresponding call
+ to WSAEventSelect(fd, 0, 0) in our destructor. */
class WSAEventWrapper
{
public:
- WSAEventWrapper(int fd, DWORD dwSelFlags);
- ~WSAEventWrapper();
+ // Default constructor. Call init() after this.
+ WSAEventWrapper();
+ WSAEventWrapper(int fd, DWORD dwSelFlags);
+ ~WSAEventWrapper();
- WSAEVENT getEventHandle()
- {
- return m_hEvent;
- }
+ // Used for two-step initialization after calling
+ // default constructor.
+ void init(int fd, DWORD dwSelFlags);
+
+ int getFD()
+ {
+ return m_fd;
+ }
+
+ WSAEVENT getEventHandle()
+ {
+ return m_hEvent;
+ }
private:
- WSAEVENT m_hEvent;
- int m_fd;
- DWORD m_dwSelFlags;
+ WSAEVENT m_hEvent;
+ int m_fd;
+ DWORD m_dwSelFlags;
};
// Error string text. The int argument is compatible
@@ -141,7 +152,6 @@ _Jv_ThrowSocketException ();
extern void _Jv_platform_initialize (void);
extern void _Jv_platform_initProperties (java::util::Properties*);
extern jlong _Jv_platform_gettimeofday ();
-extern int _Jv_select (int n, fd_set *, fd_set *, fd_set *, struct timeval *);
extern int _Jv_pipe (int filedes[2]);
extern void