From 9ed9eda6736c84c03229e92b3a0c0d23792b5728 Mon Sep 17 00:00:00 2001 From: Scott Gilbertson Date: Mon, 7 Mar 2005 16:49:37 +0000 Subject: natXAnyEvent.cc (loadNext): Added timeout. 2005-04-07 Scott Gilbertson * gnu/gcj/xlib/natXAnyEvent.cc (loadNext): Added timeout. * gnu/awt/xlib/XCanvasPeer.java (setBackground): Removed throw UnsupportedOperationException, fixed comments. (setFont, setForeground): Fixed comments. * gnu/awt/xlib/XEventLoop.java (postNextEvent): Changed return type to boolean. (getNextEvent): Fixed javadocs. * gnu/awt/xlib/XToolkit.java (interrupted): Removed field. (nativeQueueEmpty): Removed unused code. (iterateNativeQueue): Removed outer loop. From-SVN: r96029 --- libjava/gnu/gcj/xlib/natXAnyEvent.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libjava/gnu/gcj') diff --git a/libjava/gnu/gcj/xlib/natXAnyEvent.cc b/libjava/gnu/gcj/xlib/natXAnyEvent.cc index 0bef563..26d3b60 100644 --- a/libjava/gnu/gcj/xlib/natXAnyEvent.cc +++ b/libjava/gnu/gcj/xlib/natXAnyEvent.cc @@ -69,11 +69,14 @@ jboolean gnu::gcj::xlib::XAnyEvent::loadNext(jboolean block) int xfd = XConnectionNumber(dpy); int pipefd = pipe[0]; int n = (xfd > pipefd ? xfd : pipefd) + 1; + struct timeval timeout; + timeout.tv_usec = 100000; // 100ms timeout + timeout.tv_sec = 0; fd_set rfds; FD_ZERO(&rfds); FD_SET(xfd, &rfds); FD_SET(pipefd, &rfds); - int sel = _Jv_select (n, &rfds, NULL, NULL, NULL); + int sel = _Jv_select (n, &rfds, NULL, NULL, &timeout); if (sel > 0) { if (FD_ISSET(xfd, &rfds)) -- cgit v1.1