github.com/octohelm/storage@v0.0.0-20240516030302-1ac2cc1ea347/internal/sql/adapter/sqlite/mutex_set.go (about)

     1  package sqlite
     2  
     3  import "sync"
     4  
     5  type mutexSet struct {
     6  	m sync.Map
     7  }
     8  
     9  func (s *mutexSet) of(path string) *sync.Mutex {
    10  	got, _ := s.m.LoadOrStore(path, &sync.Mutex{})
    11  	return got.(*sync.Mutex)
    12  }