Listing 3: The Writer Thread // The queue queue power2Queue; // Mutex and condition variable for controlling access to the queue mutex_t queueReady; cond_t signalQueueReady; // Initialize the mutex and condition variable mutex_init(&queueReady, USYNC_THREAD, NULL); cond_init(&signalQueueReady, USYNC_THREAD, NULL); ... // Lock the queue and add some data mutex_lock(&queueReady); power2Queue.push(999); // Inform the reader that some data is available cond_signal(&signalQueueReady); mutex_unlock(&queueReady);