flock/open random error

Jakob Bohm jb-cygwin@wisemo.com
Thu Nov 13 05:16:49 GMT 2025


On 12/11/2025 10:24, Takashi Yano via Cygwin wrote:
> On Tue, 21 Oct 2025 17:41:51 -0700
> Nahor wrote:
>> ...
>>
>> I haven't been able to reproduce the missing data in the history file
>> so it's unknown if it's an issue in Fish or flock not locking properly
>> at times. So far the test passes on Linux and MacOS.
> Thanks for the report.
>
> Do you have any evidence that flock() should be MT-safe?
> This issue seems to be caused by the fact that flock() in
> cygwin is not MT-safe.
>
> If flock is guarded by mutex in your test case, the issue
> does not happen.
>
By definition, all standard APIs and certainly all synchronization
APIs on systems with threads support need to be thread safe to avoid
embarrassing failures.

Enjoy

Jakob
-- 
Jakob Bohm, CIO, Partner, WiseMo A/S.  https://www.wisemo.com
Transformervej 29, 2860 Søborg, Denmark.  Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded



More information about the Cygwin mailing list