August 1999
Intermediate to advanced
1488 pages
72h 53m
English
project.lock()
The lock() method of the project object locks the code in which you are working until you perform an unlock. If the code is already locked, this method will wait until it can get the lock, a timeout occurs, or an error occurs.
Listing 8.99 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.
<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