added thread safe locked queue using lock and condition variable (c++11)