msvcrt: Don't hold FILE critical section in some functions

Alexandre Julliard julliard at winehq.org
Tue Nov 15 09:34:15 CST 2011


Piotr Caban <piotr at codeweavers.com> writes:

> @@ -3117,25 +3098,20 @@ int CDECL MSVCRT_fputc(int c, MSVCRT_FILE* file)
>   */
>  int CDECL MSVCRT__flsbuf(int c, MSVCRT_FILE* file)
>  {
> -    MSVCRT__lock_file(file);
> -
>      /* Flush output buffer */
>      if(file->_bufsiz == 0 && !(file->_flag & MSVCRT__IONBF)) {
>          msvcrt_alloc_buffer(file);
>      }
>      if(!(file->_flag & MSVCRT__IOWRT)) {
> -        if(file->_flag & MSVCRT__IORW) {
> +        if(file->_flag & MSVCRT__IORW)
>              file->_flag |= MSVCRT__IOWRT;
> -        } else {
> -            MSVCRT__unlock_file(file);
> +        else

That doesn't look safe.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list