aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32proc.c
diff options
context:
space:
mode:
authorJoakim Verona2012-12-30 00:03:52 +0100
committerJoakim Verona2012-12-30 00:03:52 +0100
commitea2da3d8fbf19765a9bd82292bfc73918f74048d (patch)
treeb350dbdaa6601f4384a3fbde01eeaea297d4f047 /src/w32proc.c
parent16b9f224223b3e9eb0c4b313e4257dacbd3ebe34 (diff)
parenteff2eb5812e964024c3aa20197b21f12d37155dd (diff)
downloademacs-ea2da3d8fbf19765a9bd82292bfc73918f74048d.tar.gz
emacs-ea2da3d8fbf19765a9bd82292bfc73918f74048d.zip
auto upstream
Diffstat (limited to 'src/w32proc.c')
-rw-r--r--src/w32proc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/w32proc.c b/src/w32proc.c
index 5c43a57db29..8977ca38a15 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -970,6 +970,11 @@ reader_thread (void *arg)
970 else 970 else
971 rc = _sys_read_ahead (cp->fd); 971 rc = _sys_read_ahead (cp->fd);
972 972
973 /* Don't bother waiting for the event if we already have been
974 told to exit by delete_child. */
975 if (cp->status == STATUS_READ_ERROR || !cp->char_avail)
976 break;
977
973 /* The name char_avail is a misnomer - it really just means the 978 /* The name char_avail is a misnomer - it really just means the
974 read-ahead has completed, whether successfully or not. */ 979 read-ahead has completed, whether successfully or not. */
975 if (!SetEvent (cp->char_avail)) 980 if (!SetEvent (cp->char_avail))
@@ -986,6 +991,11 @@ reader_thread (void *arg)
986 if (rc == STATUS_READ_FAILED) 991 if (rc == STATUS_READ_FAILED)
987 break; 992 break;
988 993
994 /* Don't bother waiting for the acknowledge if we already have
995 been told to exit by delete_child. */
996 if (cp->status == STATUS_READ_ERROR || !cp->char_consumed)
997 break;
998
989 /* Wait until our input is acknowledged before reading again */ 999 /* Wait until our input is acknowledged before reading again */
990 if (WaitForSingleObject (cp->char_consumed, INFINITE) != WAIT_OBJECT_0) 1000 if (WaitForSingleObject (cp->char_consumed, INFINITE) != WAIT_OBJECT_0)
991 { 1001 {
@@ -993,6 +1003,8 @@ reader_thread (void *arg)
993 "%lu for fd %ld\n", GetLastError (), cp->fd)); 1003 "%lu for fd %ld\n", GetLastError (), cp->fd));
994 break; 1004 break;
995 } 1005 }
1006 /* delete_child sets status to STATUS_READ_ERROR when it wants
1007 us to exit. */
996 if (cp->status == STATUS_READ_ERROR) 1008 if (cp->status == STATUS_READ_ERROR)
997 break; 1009 break;
998 } 1010 }