title: How to implement a blocking queue in C++ to process data between threads?
body: <p>I need to make an app that will have two threads.
  One will produce data (file paths and an action to be performed for that path - create/update/delete) and the other thread will need to consume this data and actually perform the tasks.</p>
  
  <p>For this I thought to have a queue and from one thread to put data in it and from the other to take the items and performa the actions sequentially.</p>
  
  <p>My problem is how do I make this data to be shareable between these threads and then how can I make the second thread to block while waiting for data to be put in the queue? Just having a while to check if queue is not empty would eat CPU like crazy for nothing. Adding a "sleep" to check every few milliseconds or seconds would not be efficient.</p>
  
  <p>How can this be done? Any libraries that implement such data?</p>