开发者

Does CFRETURN in a CFLOCK properly release the lock?

开发者 https://www.devze.com 2023-03-27 08:33 出处:网络
I am writing some code with CFLOCK tags, and am at a point where my code would return somewhere within a CFLOCK.Example:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号