1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 00:22:41 +08:00
Files
go-mixed/locker/empty_locker.go
2022-05-26 14:12:42 +08:00

22 lines
386 B
Go

package locker
var EmptyLocker = &emptyLocker{}
type emptyLocker struct{}
func NewEmptyLocker() *emptyLocker {
return &emptyLocker{}
}
func (l *emptyLocker) RLock() {}
func (l *emptyLocker) RUnlock() {}
func (l *emptyLocker) Lock() {}
func (l *emptyLocker) Unlock() {}
func (l *emptyLocker) TryLock() bool { return true }
func (l *emptyLocker) TryRLock() bool { return true }