LIU Hao wrote:

> If someone forgot to initialize their mutex like `static pthread_mutex_t 
> mutex;`, they would have a
> zero-initialized mutex.

By taking a quick look at cond.c and rwlock.c, they seem to treat such 
zero-initialized object as invalid and fail with EINVAL. The code in mutex.c 
seems to be an exception.

> It is, of course, no good code; but if you revert that commit, such code 
> would be broken.

I think that code which forgets to properly initialize such static object is 
broken and really should fail to signal that code needs to be fixed.

Still, if you think we should continue allowing zero-initialized 
`pthread_mutex_t`, I'll keep this *feature* as-is.

- Kirill Makurin


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

Reply via email to