msvcrt: Make fflush function thread safe.

This commit is contained in:
Piotr Caban 2011-05-20 13:21:29 +02:00 committed by Alexandre Julliard
parent 23a0d0f04a
commit d18f0766f7
1 changed files with 12 additions and 7 deletions

View File

@ -777,7 +777,12 @@ int CDECL MSVCRT_fflush(MSVCRT_FILE* file)
if(!file) {
_flushall();
} 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 0;