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