Prev Next OpenBSD and Rthreads Slide #26

Mutex and Condvar

        T1: mutex_lock(&mutex)
        T1: cond_wait(&cond, &mutex)                    /* down */
                        T2: mutex_lock(&mutex)
                        T2: cond_signal(&cond)          /* up */
                        T2: cond_wait(&cond, &mutex)    /* down */


EuroBSDCon 2012 Copyright © 2012 Philip Guenther