Renamed a mutex variable

Renamed a mutex variable from 'mutex' to 'gen_mutex' to make it clear
what it is guarding.