summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-09-01 03:31:05 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-09-01 03:31:05 +0000
commit2252d4ce028b38bb46310b215b2c98afbf224d55 (patch)
tree4bc848c3b8cdde1032611e27217cec98134055e2 /win32
parent6001314def338002ae1dc50bcf120805bee78a44 (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/win32/win32.c b/win32/win32.c
index c024ca0..2bf1bb1 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 */
}