mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
eban
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4378cbc023
commit
e1461461cc
1 changed files with 7 additions and 3 deletions
|
@ -1558,11 +1558,15 @@ EXTERN_C void __cdecl _lock_fhandle(int);
|
||||||
EXTERN_C void __cdecl _unlock_fhandle(int);
|
EXTERN_C void __cdecl _unlock_fhandle(int);
|
||||||
EXTERN_C void __cdecl _unlock(int);
|
EXTERN_C void __cdecl _unlock(int);
|
||||||
|
|
||||||
|
#if defined _MT || defined __MSVCRT__
|
||||||
|
#define MSVCRT_THREADS
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
long osfhnd; /* underlying OS file HANDLE */
|
long osfhnd; /* underlying OS file HANDLE */
|
||||||
char osfile; /* attributes of file (e.g., open in text mode?) */
|
char osfile; /* attributes of file (e.g., open in text mode?) */
|
||||||
char pipech; /* one char buffer for handles opened on pipes */
|
char pipech; /* one char buffer for handles opened on pipes */
|
||||||
#ifdef _MT
|
#ifdef MSVCRT_THREADS
|
||||||
int lockinitflag;
|
int lockinitflag;
|
||||||
CRITICAL_SECTION lock;
|
CRITICAL_SECTION lock;
|
||||||
#endif
|
#endif
|
||||||
|
@ -1598,7 +1602,7 @@ _alloc_osfhnd(void)
|
||||||
CloseHandle(hF);
|
CloseHandle(hF);
|
||||||
if (fh == -1)
|
if (fh == -1)
|
||||||
return fh;
|
return fh;
|
||||||
#ifdef _MT
|
#ifdef MSVCRT_THREADS
|
||||||
EnterCriticalSection(&(_pioinfo(fh)->lock));
|
EnterCriticalSection(&(_pioinfo(fh)->lock));
|
||||||
#endif
|
#endif
|
||||||
return fh;
|
return fh;
|
||||||
|
@ -1635,7 +1639,7 @@ my_open_osfhandle(long osfhandle, int flags)
|
||||||
fileflags |= FOPEN; /* mark as open */
|
fileflags |= FOPEN; /* mark as open */
|
||||||
|
|
||||||
_osfile(fh) = fileflags; /* set osfile entry */
|
_osfile(fh) = fileflags; /* set osfile entry */
|
||||||
#ifdef _MT
|
#ifdef MSVCRT_THREADS
|
||||||
LeaveCriticalSection(&_pioinfo(fh)->lock);
|
LeaveCriticalSection(&_pioinfo(fh)->lock);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue