CFLOCK 中的 CFRETURN 是否正确释放锁?
我正在使用 CFLOCK 标签编写一些代码,并且我的代码将返回 CFLOCK 内的某个位置。示例:
<cflock timeout="30" name="mylock">
... do some processing ...
<cfif processfailed>
<cfreturn "">
</cfif>
... some more processing ...
</cflock>
如果 CFRETURN 触发,锁是否会被释放,或者我是否需要以其他方式处理我的代码?
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">
... 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当返回触发时,锁被释放。
The lock gets released when the return fires.
据我所知,它工作得很好。但如果您担心,只需将您的 cfif 移到锁块之外即可。
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.