mirror of
https://github.com/libp2p/go-libp2p-peerstore.git
synced 2025-03-13 11:30:09 +08:00
Mutex hat pattern
This commit is contained in:
parent
7e3363eeb4
commit
b550e5b2c6
@ -207,10 +207,11 @@ type ttlentry struct {
|
||||
type ttlmanager struct {
|
||||
sync.RWMutex
|
||||
entries map[ds.Key]*ttlentry
|
||||
ctx context.Context
|
||||
cancel context.CancelFunc
|
||||
ticker *time.Ticker
|
||||
ds ds.Datastore
|
||||
|
||||
ctx context.Context
|
||||
cancel context.CancelFunc
|
||||
ticker *time.Ticker
|
||||
ds ds.Datastore
|
||||
}
|
||||
|
||||
func newTTLManager(parent context.Context, d ds.Datastore, tick time.Duration) *ttlmanager {
|
||||
|
Loading…
Reference in New Issue
Block a user