extend stdlib to allow import of more packages (#1099)

* stdlib: extend stdlib to allow import of more packages
This commit is contained in:
Cornel
2020-06-23 12:56:28 +03:00
committed by GitHub
parent de45da5df4
commit 720a54a0fe
16 changed files with 549 additions and 13 deletions
+11
View File
@@ -74,3 +74,14 @@ type Locker interface {
Lock()
Unlock()
}
// RLocker returns a Locker interface that implements
// the Lock and Unlock methods by calling rw.RLock and rw.RUnlock.
func (rw *RWMutex) RLocker() Locker {
return (*rlocker)(rw)
}
type rlocker RWMutex
func (r *rlocker) Lock() { (*RWMutex)(r).RLock() }
func (r *rlocker) Unlock() { (*RWMutex)(r).RUnlock() }