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

[JCSprout-175]修改一点语病 #192

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MD/Java-lock.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

解决方案:
- 数据库切换为主从,不存在单点。
- 在表中加入一个同步状态字段,每次获取锁的是加 1 ,释放锁的时候`-1`,当状态为 0 的时候就删除这条记录,即释放锁。
- 在表中加入一个同步状态字段,每次获取锁的时候加 `1`,释放锁的时候 `-1`,当状态为 0 的时候就删除这条记录,即释放锁。
- 非阻塞的情况可以用 `while` 循环来实现,循环的时候记录时间,达到 X 秒记为超时,`break`。
- 可以开启一个定时任务每隔一段时间扫描找出多少 X 秒都没有被删除的记录,主动删除这条记录。

Expand Down