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