I am writing some code with CFLOCK tags, and am at a point where my code would return somewhere within a CFLOCK. Example:
<cflock timeout="30" name="mylock">
.开发者_StackOverflow中文版.. do some processing ...
<cfif processfailed>
<cfreturn "">
</cfif>
... some more processing ...
</cflock>
If the CFRETURN fires, does the lock get released, or will I need to work my code around some other way?
The lock gets released when the return fires.
As near as I can tell, it works just fine. But if you are worried about it, just move your cfif outside of the lock block.
精彩评论