Add mutex for each resources to protect visit