Adding patches for DQM multi-threading

Adding patches for DQM multi-threading