摘要: 使用redis实现一个简单的分布式锁,主要是使用redis的setnx和getset方法进行实现。 加锁: 1.使用setnx设置值: key:为需要加锁的锁名 value 为 当前时间+锁的超时时间 ... 阅读全文
posted @ 2016-10-30 17:19 huan1993 阅读(23) 评论(0) 推荐(0) 编辑