Is it possible to initialize mutex in this way:
pthread_mutex_t mutex = {0};
What is the difference between the following 3 initialization of mutex:
1) pthread_mutex_init(&mutex, NULL);
2) pthread_mutex_t mutex = {0};
3) pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
&mutex) by calling the initializer function explicitly.pthread_mutex_t object, which is supposed to be opaque. It should not be used.See also: http://pubs.opengroup.org/onlinepubs/7908799/xsh/pthread_mutex_init.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With