From b013cf9d7ad8d9a531af06304ed6627669568a58 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 18 Oct 2008 14:33:51 +0000 Subject: [PATCH] fix Windows repairs for ports svn: r12057 --- src/mzscheme/src/port.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mzscheme/src/port.c b/src/mzscheme/src/port.c index c39142dec6..5de7d3774b 100644 --- a/src/mzscheme/src/port.c +++ b/src/mzscheme/src/port.c @@ -126,6 +126,7 @@ typedef struct Win_FD_Input_Thread { HANDLE eof; unsigned char *buffer; HANDLE checking_sema, ready_sema, you_clean_up_sema; + HANDLE thread; } Win_FD_Input_Thread; static HANDLE refcount_sema; @@ -5130,6 +5131,8 @@ make_fd_input_port(int fd, Scheme_Object *name, int regfile, int win_textmode, i h = CreateThread(NULL, 4096, (LPTHREAD_START_ROUTINE)WindowsFDReader, th, 0, &id); + th->thread = h; + scheme_remember_thread(h, 1); } #endif @@ -5957,8 +5960,8 @@ static long flush_fd(Scheme_Output_Port *op, oth->ready_sema = sm; sm = CreateSemaphore(NULL, 1, 1, NULL); oth->you_clean_up_sema = sm; - if (refcount) { - oth->refcount = refcount; + if (fop->refcount) { + oth->refcount = fop->refcount; if (!refcount_sema) refcount_sema = CreateSemaphore(NULL, 1, 1, NULL); }