On Mon, Sep 12, 2022, 9:46 AM Zebediah Figura <zfigura@codeweavers.com> wrote:
On 9/11/22 19:38, Jin-oh Kang wrote:
>> and secondly because it's actually quite hard if not
>> impossible to implement (POSIX has no way to wait for a mandatory lock,
>> for instance).
>>
>
> We don't use POSIX locks to implement file locks; they are emulated
> entirely in the server, which I guess is specifically designed to avoid
> that problem with POSIX file lock semantics. Thus, this won't be *that*
> hard to implement; nonetheless, asynchronous I/O is not really easy to
> implement in general, especially for those new to wine codebase.

I don't see where you're getting that; we do indeed use POSIX locks. See
set_unix_lock() in server/fd.c.

I stand corrected.

There's no poll() for file locks, so it would have to busy-wait anyway.

I did incorrectly use the term
"mandatory", though; we don't set mandatory locks on a file.