Merge branch 'yjqww6-master'

original commit: 461bd944847bc9a1ff54a804fec450cd86969990
This commit is contained in:
dybvig 2016-06-14 23:49:21 -04:00
commit 8d28c6afb9
2 changed files with 22 additions and 2 deletions

2
LOG
View File

@ -207,3 +207,5 @@
c/Mf-*, c/Makefile.*nt
- removed unnecessary datestamp.c target
c/Mf.*nt
- fixed unnessesary blocking in expeditor on Windows.
c/expeditor.c

View File

@ -73,6 +73,10 @@ static IBOOL s_ee_init_term(void) {
static ptr s_ee_read_char(IBOOL blockp) {
DWORD cNumRead;
INPUT_RECORD irInBuf[1];
#ifdef PTHREADS
ptr tc;
#endif /* PTHREADS */
BOOL succ;
static char buf[10];
static int bufidx = 0;
static int buflen = 0;
@ -95,8 +99,22 @@ static ptr s_ee_read_char(IBOOL blockp) {
S_LastErrorString());
if (NumberOfEvents == 0) return Sfalse;
}
if (!ReadConsoleInput(hStdin, irInBuf, 1, &cNumRead))
#ifdef PTHREADS
tc = get_thread_context();
if (DISABLECOUNT(tc) == FIX(0)) {
deactivate_thread(tc);
succ = ReadConsoleInput(hStdin, irInBuf, 1, &cNumRead);
reactivate_thread(tc);
} else {
succ = ReadConsoleInput(hStdin, irInBuf, 1, &cNumRead);
}
#else /* PTHREADS */
succ = ReadConsoleInput(hStdin, irInBuf, 1, &cNumRead);
#endif /* PTHREADS */
if (!succ)
S_error1("expeditor", "error getting console info: ~a",
S_LastErrorString());