Go · Class
sync.RWMutex
sync.RWMutex allows many readers or one writer to access shared data. A waiting writer prevents new readers from entering, which helps the writer eventually acquire the lock.
Last updated
Syntax
type RWMutex struct {}
func (rw *RWMutex) RLock()
func (rw *RWMutex) RUnlock()
func (rw *RWMutex) Lock()
func (rw *RWMutex) Unlock()
func (rw *RWMutex) TryRLock() bool
func (rw *RWMutex) TryLock() bool
func (rw *RWMutex) RLocker() LockerIn-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
RWMutexRLockTryRLockRUnlockLockTryLockUnlockRLocker