switch from pthread mutex to QMutex