// Create a new Lock object under the project object var project.myLock = new Lock(); // Verify the lock if(!project.myLock.isValid()){ write('There has been an error constructing your lock'); }else{ // Lock the code and increment a project counter project.myLock.lock(); project.hitCount.num += 1; // Unlock the code project.myLock.unlock(); }