We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
在表中加入一个同步状态字段,每次获取锁的是加 1 ,释放锁的时候-1,当状态为 0 的时候就删除这条记录,即释放锁。
实现重入锁时,并不能区分当前线程是否就是锁的持有者
insert into `t_lock`(`id`,`count`) values(1,1); update `t_lock` set `count` = `count`-1 where `id` = 1 and `count`>0;
The text was updated successfully, but these errors were encountered:
实现重入锁的话要多加字段吧
Sorry, something went wrong.
感觉要加上两个字段表示机器名和线程名。
顺便我觉得这句话
每次获取锁的是加 1
是不是应该改成
每次获取锁的时候加1
欢迎提交 pr 来修复这个问题。
我也期待这个pr
No branches or pull requests
实现重入锁时,并不能区分当前线程是否就是锁的持有者
The text was updated successfully, but these errors were encountered: