Hello everyone!
I am making a very simple lightweight audio/video playback engine. I have split the audio into 2 threads - one decoding (using ffmpeg), and the other playing the audio (throught libao). I am using pthreads for threading.

Now, how can I "neatly" implement pausing playback? I have tried locking a variable and checking its condition, but that uses a lot of CPU. Would using signals be good?

Thanks.