Files
kubesphere/vendor/github.com/antlr4-go/antlr/v4/mutex.go
hongming 4d88ed2ca1 update dependencies (#6519)
Signed-off-by: hongming <coder.scala@gmail.com>
2025-05-29 15:51:37 +08:00

42 lines
647 B
Go

//go:build !antlr.nomutex
// +build !antlr.nomutex
package antlr
import "sync"
// Mutex is a simple mutex implementation which just delegates to sync.Mutex, it
// is used to provide a mutex implementation for the antlr package, which users
// can turn off with the build tag -tags antlr.nomutex
type Mutex struct {
mu sync.Mutex
}
func (m *Mutex) Lock() {
m.mu.Lock()
}
func (m *Mutex) Unlock() {
m.mu.Unlock()
}
type RWMutex struct {
mu sync.RWMutex
}
func (m *RWMutex) Lock() {
m.mu.Lock()
}
func (m *RWMutex) Unlock() {
m.mu.Unlock()
}
func (m *RWMutex) RLock() {
m.mu.RLock()
}
func (m *RWMutex) RUnlock() {
m.mu.RUnlock()
}