在 2026-9-22 11:03, Kirill Makurin 写道:
Hello,These are the final mutex changes for now. We are still missing support for a few POSIX realtime extensions, but IMO it is not a big issue for majority of the users. Maybe we can consider adding support for them in a long run, perhaps after fixing existing issue.
Thanks. These mostly look good to me, except
+static int WinpthreadsRecursiveRobustMutexLock (WinpthreadsMutex *wMutex,
const struct _timespec64 *waitUntil) {
+ WinpthreadsRecursiveRobustMutex *mutex = &wMutex->RecursiveRobustMutex;
+
+ /**
+ * The pthread_mutex_lock() function shall fail if:
+ *
+ * [ENOTRECOVERABLE]
+ * The state protected by the mutex is not recoverable.
+ */
+ if (unlikely (mutex->State == Unrecoverable)) {
+ return ENOTRECOVERABLE;
+ }
+
+ DWORD threadId = GetCurrentThreadId ();
+
+ if (mutex->Owner == threadId) {
As a robust mutex specifically handles the case where the owner thread no longer exists, `mutex->Owner` might be recycled and reused for a different thread.
Because a Windows Mutex object is recursive itself, it's probably not necessary record this information in user mode?
-- Best regards, LIU Hao
OpenPGP_signature.asc
Description: OpenPGP digital signature
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
