From 2252d4ce028b38bb46310b215b2c98afbf224d55 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 1 Sep 2000 03:31:05 +0000 Subject: matz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- win32/win32.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'win32/win32.c') diff --git a/win32/win32.c b/win32/win32.c index c024ca04cb..2bf1bb1dbc 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1562,8 +1562,10 @@ typedef struct { long osfhnd; /* underlying OS file HANDLE */ char osfile; /* attributes of file (e.g., open in text mode?) */ char pipech; /* one char buffer for handles opened on pipes */ +#ifdef _MT int lockinitflag; CRITICAL_SECTION lock; +#endif } ioinfo; #if !defined _CRTIMP @@ -1596,7 +1598,9 @@ _alloc_osfhnd(void) CloseHandle(hF); if (fh == -1) return fh; +#ifdef _MT EnterCriticalSection(&(_pioinfo(fh)->lock)); +#endif return fh; } @@ -1631,7 +1635,9 @@ my_open_osfhandle(long osfhandle, int flags) fileflags |= FOPEN; /* mark as open */ _osfile(fh) = fileflags; /* set osfile entry */ -// _unlock_fhandle(fh); +#ifdef _MT + LeaveCriticalSection(&_pioinfo(fh)->lock); +#endif return fh; /* return handle */ } -- cgit v1.2.3