Problem Description
Is there any difference between
pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
**Or**
pthread_mutex_t lock;
pthread_mutex_init ( &lock, NULL);
Am I safe enough if I use only the first method ?
**NOTE:** My question mostly refers to very small programs where at the most what I'll do is connect several clients to a server and resolve their inquiries with worker threads.
AI-Generated Solution
Powered by LMSouq AI · GPT-4.1-mini
Analyzing problem and generating solution…
Was this solution helpful?