No need to have mi->run_lock and mi->rli.run_lock, we can have one mutex instead of these 2 (cases where one is acquired and not the other are quite rare, so we would benefit by having only one, as far as speed and code simplicity is concerned). So simply drop mi->rli.run_lock and use mi->run_lock instead, after checking that it introduces no bug and updating comments (slave.h). The same way, drop mi->rli.start_cond and mi->rli.stop_cond (check that mi->start_cond mi->stop_cond and those 2 are always used inside a while(), then it's safe to do the replacement). To do in 5.0, as it's: - not a small code change (difficult merge maybe) - relatively safe change
