File: sync_map.go

package info (click to toggle)
golang-github-aws-aws-sdk-go 1.44.133-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 245,296 kB
  • sloc: makefile: 120
file content (30 lines) | stat: -rw-r--r-- 503 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//go:build go1.9
// +build go1.9

package crr

import (
	"sync"
)

type syncMap sync.Map

func newSyncMap() syncMap {
	return syncMap{}
}

func (m *syncMap) Load(key interface{}) (interface{}, bool) {
	return (*sync.Map)(m).Load(key)
}

func (m *syncMap) Store(key interface{}, value interface{}) {
	(*sync.Map)(m).Store(key, value)
}

func (m *syncMap) Delete(key interface{}) {
	(*sync.Map)(m).Delete(key)
}

func (m *syncMap) Range(f func(interface{}, interface{}) bool) {
	(*sync.Map)(m).Range(f)
}