4
votes
1answer
84 views

Please review for - any unnecesary casting, memory leaks,wrong use of pthread call, or validation problem is there in the given code fragment

/********************************************************************** * FILENAME :thread_1.c * DESCRIPTION:Contains Code for a program that demonstrates the * use of pthread ...
1
vote
1answer
202 views

std::lock implementation in C with pthreads

I messed a little bit with pthreads and needed an alternative to the C++11 function std::lock (2 args are enough), this is what I came up with: void lock(pthread_mutex_t* m1, pthread_mutex_t* m2) { ...