Started looking into threads, mutex and cond variables in c++11