fix Windows repairs for ports

svn: r12057
This commit is contained in:
Matthew Flatt 2008-10-18 14:33:51 +00:00
parent 69685db892
commit b013cf9d7a

View File

@ -126,6 +126,7 @@ typedef struct Win_FD_Input_Thread {
HANDLE eof; HANDLE eof;
unsigned char *buffer; unsigned char *buffer;
HANDLE checking_sema, ready_sema, you_clean_up_sema; HANDLE checking_sema, ready_sema, you_clean_up_sema;
HANDLE thread;
} Win_FD_Input_Thread; } Win_FD_Input_Thread;
static HANDLE refcount_sema; 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); h = CreateThread(NULL, 4096, (LPTHREAD_START_ROUTINE)WindowsFDReader, th, 0, &id);
th->thread = h;
scheme_remember_thread(h, 1); scheme_remember_thread(h, 1);
} }
#endif #endif
@ -5957,8 +5960,8 @@ static long flush_fd(Scheme_Output_Port *op,
oth->ready_sema = sm; oth->ready_sema = sm;
sm = CreateSemaphore(NULL, 1, 1, NULL); sm = CreateSemaphore(NULL, 1, 1, NULL);
oth->you_clean_up_sema = sm; oth->you_clean_up_sema = sm;
if (refcount) { if (fop->refcount) {
oth->refcount = refcount; oth->refcount = fop->refcount;
if (!refcount_sema) if (!refcount_sema)
refcount_sema = CreateSemaphore(NULL, 1, 1, NULL); refcount_sema = CreateSemaphore(NULL, 1, 1, NULL);
} }