1 Star 1 Fork 0

eatmoreapple/juice

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
locker.go 506 Bytes
一键复制 编辑 原始数据 按行查看 历史
多吃点苹果 提交于 2024-05-27 16:05 . replace default lock (#289)
package juice
import "sync"
// RWLocker is a interface that can be used to lock、unlock and read lock、read unlock.
type RWLocker interface {
RLock()
RUnlock()
Lock()
Unlock()
}
type RWMutex = sync.RWMutex
var _ RWLocker = (*RWMutex)(nil)
// NoOpRWMutex is a no-op implementation of RWLocker.
type NoOpRWMutex struct{}
func (l *NoOpRWMutex) RLock() {}
func (l *NoOpRWMutex) RUnlock() {}
func (l *NoOpRWMutex) Lock() {}
func (l *NoOpRWMutex) Unlock() {}
var _ RWLocker = (*NoOpRWMutex)(nil)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/eatmoreapple/juice.git
git@gitee.com:eatmoreapple/juice.git
eatmoreapple
juice
juice
main

搜索帮助