Lock the server scope. Unlock the server scope. Unlock the application scope. Unlock the session scope. For example, you can take out Steps 3 and 4 if you do not need to lock the server scope.
Similar rules apply for named locks.
You should copy the following code into an Application.cfm file in the snippets directory. Initialize the session and application variables that will be used by E-Turtleneck. Use the session scope for the session variables. Use the application lock for the application variable. This variable keeps track of the total number of turtlenecks sold.