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

21 lines
221 B
Go

package locker
import "sync"
type Locker interface {
Lock()
Unlock()
TryLock() bool
}
type RWLocker interface {
Locker
RLock()
RUnlock()
TryRLock() bool
}
func NewLocker() *sync.Mutex {
return &sync.Mutex{}
}