在 2026-9-9 00:06, Kirill Makurin 写道:
> 0019, 0020, 0021 delete tests for `pthread_mutexattr_gettype()`.I mentioned that I want to add support for POSIX robust mutexes next, and this would require adding `pthread_mutexattr_{set,get}robust`. As a preparation step, I want to update `pthread_mutexattr_*` functions and add tests for each of them.However, if you insist on keeping tests for `pthread_mutexattr_gettype` for now, I can change 0019.txt, 0020.txt and 0021.txt to preserve it. What you say?
It should be preferred to keep existing tests.
> 0023 has this: > > assert(pthread_create(&thread, NULL, ThreadA, &mutex) == 0); > Sleep(100); > /** > * Ensure we do not dead lock if thread did not lock mutex fast enough. > */ > assert(pthread_mutex_trylock(&mutex) == EBUSY); > > I think this is a bit fragile; you can use a barrier here.Yeah, I had mixing feeling about this. Will it be ok to loop with `InterlockedExchange` in main until thread sets a variable? I hesitate to use `pthread_barrier_t` because its implementation uses `pthread_mutex_t`, so it would be a bit awkward.
Right; probably you want a Windows event which will be set after the child thread has acquired the mutex. -- 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
