aboutsummaryrefslogtreecommitdiff
path: root/gdb/mingw-hdep.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2006-04-24 21:00:13 +0000
committerDaniel Jacobowitz <drow@false.org>2006-04-24 21:00:13 +0000
commitc3e2b812d0111da86f66fced7b33492261db1480 (patch)
tree8215cd8205ff2c01839cb76825b748818aabed97 /gdb/mingw-hdep.c
parentfbefa34ecb796d084af2d1a58c9cb651e2b4a62e (diff)
downloadgdb-c3e2b812d0111da86f66fced7b33492261db1480.zip
gdb-c3e2b812d0111da86f66fced7b33492261db1480.tar.gz
gdb-c3e2b812d0111da86f66fced7b33492261db1480.tar.bz2
* ser-mingw.c: Include <conio.h>.
(struct ser_console_state, struct net_windows_state): Add exit_select, have_stopped, thread. (pipe_select_thread, console_select_thread) (net_windows_select_thread): Don't create a local state copy or close stop_select. Exit on exit_select instead of stop_select. Set have_stopped. (console_select_thread): Don't report control keypresses as pending input. (pipe_select_thread): Allow stop_select to interrupt sleeping. (set_console_wait_handle): Create exit_select and have_stopped. Save the thread handle. Check _kbhit before starting a thread. (ser_console_done_wait_handle): New. (ser_console_close): Close new handles. Wait for the thread to exit. (new_windows_select_thread): Assert that an event occurred. (net_windows_wait_handle): Check for pending input before starting a thread. (net_windows_done_wait_handle): New. (net_windows_open): Create exit_select and have_stopped. Save the thread handle. (net_windows_close): Close new handles. Wait for the thread to exit. (_intiialize_ser_windows): Register done_wait_handle methods. * serial.c [USE_WIN32API] (serial_done_wait_handle): New. * serial.h [USE_WIN32API] (struct serial_ops): Add done_wait_handle. [USE_WIN32API] (serial_done_wait_handle): New prototype. * mingw-hdep.c (gdb_select): Use serial_done_wait_handle.
Diffstat (limited to 'gdb/mingw-hdep.c')
-rw-r--r--gdb/mingw-hdep.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/mingw-hdep.c b/gdb/mingw-hdep.c
index 79b23dc..bb0f50a 100644
--- a/gdb/mingw-hdep.c
+++ b/gdb/mingw-hdep.c
@@ -167,6 +167,10 @@ gdb_select (int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
for (fd = 0, indx = 0; fd < n; ++fd)
{
HANDLE fd_h;
+ struct serial *scb;
+
+ if (!FD_ISSET (fd, readfds) && !FD_ISSET (fd, writefds))
+ continue;
if (FD_ISSET (fd, readfds))
{
@@ -189,6 +193,12 @@ gdb_select (int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
else
num_ready++;
}
+
+ /* We created at least one event handle for this fd. Let the
+ device know we are finished with it. */
+ scb = serial_for_fd (fd);
+ if (scb)
+ serial_done_wait_handle (scb);
}
return num_ready;