Added mutexes for tick and frame counters