add mutexlock in processing of baseloop