August 1999
Intermediate to advanced
1488 pages
72h 53m
English
project.unlock()
The unlock() method of the project object unlocks the code that you have locked. This method returns true if the unlocking was successful and false if otherwise.
Listing 8.100 sets a project object with a counter property, hitCount. Because you only want to increment the counter with each new user request, it must be locked. Once the counter has been incremented, the project is unlocked.
<SERVER> // Lock the code and increment a project counter project.lock(); project.hitCount += 1; // Unlock the code project.unlock(); </SERVER> |
Read now
Unlock full access