Added swith to enable/disable the internal mutex.