// Lock the code and increment a server counter server.lock(); server.totalHits += 1; // Unlock the code server.unlock();