12345678910111213141516171819202122232425262728 |
- package lock
- import (
- "context"
- "github.com/go-redis/redis/v8"
- "sync"
- )
- type RedisReentrantLock struct {
- key string
- client *redis.UniversalClient
- ctx context.Context
- identity string
- count int
- mu sync.Mutex
- stopChan chan struct{}
- }
- //func NewRedisReentrantLock(client *redis.Client, ctx context.Context, key string, identity string) *RedisReentrantLock {
- // return &RedisReentrantLock{
- // key: key,
- // client: client,
- // ctx: ctx,
- // identity: identity,
- // count: 0,
- // stopChan: make(chan struct{}),
- // }
- //}
|