add MutexLockGaurd and fix function wait of Condition