Fixed a critical lock bug in Depth-first mining.