pthread supports static initialization of pthread_mutex_t using PTHREAD_MUTEX_INITIALIZER.
Is it possible to achieve a similar static mechanism for mutex initialization using Windows mutex?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, since Windows mutex are handles, they must be initialized with
CreateMutex().Note that the static initialization of pthread_mutex_t using
PTHREAD_MUTEX_INITIALIZERis not a real init, it will be done internally at the first call topthread_mutex_lock()orpthread_mutex_trylock()