Merge changes I735d68e8,I1226ed73

* changes:
  Wait for buffer allocation
  Convert Mutex to std::mutex in BufferQueueCore/Producer/Consumer