add mutex locks to syncronize CPU worker and GPU worker, the mechanism needs to be improved