Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于锁的释放 #7

Open
dulida opened this issue May 29, 2019 · 1 comment
Open

关于锁的释放 #7

dulida opened this issue May 29, 2019 · 1 comment

Comments

@dulida
Copy link

dulida commented May 29, 2019

博主你好,小弟有些不解,按理一个请求过来,请求结束后应该释放掉该锁。可是看到代码里是在finally里调用了锁的释放,这个应该怎么理解呢?抛出重复提交的异常也要释放该锁吗?这部分理解不了啊!求教。

@WinterChenS
Copy link

建议多看看多线程相关的知识,释放锁应该放在finally里面,因为如果在运行过程中抛出异常,最后还是能成功的释放锁;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants