Why do pthreads’ condition variable functions require a mutex?

Posted by elliottcable on Stack Overflow See other posts from Stack Overflow or by elliottcable
Published on 2010-05-04T08:05:01Z Indexed on 2010/05/04 8:08 UTC
Read the original article Hit count: 751

Filed under:
|
|
|

I’m reading up on pthread.h; the condition variable related functions (like pthread_cond_wait(3)) require a mutex as an argument. Why? As far as I can tell, I’m going to be creating a mutex just to use as that argument? What is that mutex supposed to do?

© Stack Overflow or respective owner

Related posts about c

    Related posts about pthreads