开发者

Does CFRETURN in a CFLOCK properly release the lock?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜