在 2026-9-29 10:16, Kirill Makurin 写道:
Hello,

This is another version of the changes:

1. Small fix in new test pthread_mutex/attr-robust.c
2. Small fix in switch in `WinpthreadsRobustMutexTimedLock`
3. Fix code path in `*Unlock` functions for robust mutexes when `WinpthreadsRobustMutexTimedLock` returns `EOWNERDEAD`

I kept the logic of using recursive locking in `*Unlock` functions but updated comments so now they explain what each specific code path in switch means.

IMO, using any synchronization object other Windows mutex in implementation for POSIX robust mutexes is not possible as it would result in a dead lock if thread terminates while owning that lock. OTOH, using two Windows mutexes is an overkill (at least in my opinion) and would noticeably complicate the logic.

These patches look mostly fine, with only a trivial issue:

Does `mutex->State` have to be updated with an interlocked function? Looks like that it can only changed while the kernel mutex object has been locked, so it can be updated with plain assignment.




--
Best regards,
LIU Hao

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to