msvcrt: Make fflush function thread safe.
This commit is contained in:
parent
23a0d0f04a
commit
d18f0766f7
|
@ -777,7 +777,12 @@ int CDECL MSVCRT_fflush(MSVCRT_FILE* file)
|
||||||
if(!file) {
|
if(!file) {
|
||||||
_flushall();
|
_flushall();
|
||||||
} else if(file->_flag & MSVCRT__IOWRT) {
|
} else if(file->_flag & MSVCRT__IOWRT) {
|
||||||
int res=msvcrt_flush_buffer(file);
|
int res;
|
||||||
|
|
||||||
|
MSVCRT__lock_file(file);
|
||||||
|
res = msvcrt_flush_buffer(file);
|
||||||
|
MSVCRT__unlock_file(file);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue