Acquires the lock specified by ID.
CodeLock ( lockID )
CodeLock will return TRUE, if the lock is acquired.
Acquires the lock specified by ID. If the lock is already held by another agent, the thread stalls until the lock becomes available. Bear in mind that CodeLock and CodeUnLock should always be done in pairs; failure to adhere to this practice will lead to unexpected results.