ntdll: Support receiving server reply data to memory with write watch.

Alexandre Julliard julliard at winehq.org
Thu Aug 3 09:20:04 CDT 2017


Jacek Caban <jacek at codeweavers.com> writes:

> On 03.08.2017 09:48, Alexandre Julliard wrote:
>> Jacek Caban <jacek at codeweavers.com> writes:
>>
>>> @@ -256,6 +256,7 @@ static void read_reply_data( void *buffer, size_t size )
>>>          if (!ret) break;
>>>          if (errno == EINTR) continue;
>>>          if (errno == EPIPE) break;
>>> +        if (errno == EFAULT && virtual_uninterrupted_write_memory( buffer, NULL, size ) >= size) continue;
>>>          server_protocol_perror("read");
>> You can't enter a critical section in the middle of a server call.
>
> Oh, right, we could need to do another server call there. Unless I'm
> missing something, it should work fine for platforms that have optimized
> CS implementation (Linux and Mac) as they don't do server calls. We
> could limit effect of the patch to those platform, but that would be ugly.
>
> Could we just use pthread mutexes for
> server_enter_uninterrupted_section/server_leave_uninterrupted_section
> instead of critical sections?

I don't think you should be doing that sort of thing inside server calls
at all. Some sort of lock/unlock_buffer methods that could be wrapped
around server calls where necessary would probably work better.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list