- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for DRLocker (0.05 sec)
-
internal/lsync/lrwmutex.go
lm.ref = 0 lm.isWriteLock = false } // DRLocker returns a sync.Locker interface that implements // the Lock and Unlock methods by calling drw.RLock and drw.RUnlock. func (lm *LRWMutex) DRLocker() sync.Locker { return (*drlocker)(lm) } type drlocker LRWMutex func (dr *drlocker) Lock() { (*LRWMutex)(dr).RLock() }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Sun Jan 02 17:15:06 UTC 2022 - 4.8K bytes - Viewed (0) -
internal/lsync/lrwmutex_test.go
} // Borrowed from rwmutex_test.go func TestDRLocker(t *testing.T) { wl := NewLRWMutex() var rl sync.Locker wlocked := make(chan bool, 1) rlocked := make(chan bool, 1) rl = wl.DRLocker() n := 10 go func() { for i := 0; i < n; i++ { rl.Lock() rl.Lock() rlocked <- true wl.Lock() wlocked <- true } }() for i := 0; i < n; i++ { <-rlocked
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Sun Mar 05 04:57:35 UTC 2023 - 7.9K bytes - Viewed (0)