mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-12 15:03:41 +00:00
extend stdlib to allow import of more packages (#1099)
* stdlib: extend stdlib to allow import of more packages
This commit is contained in:
@@ -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() }
|
||||
|
||||
Reference in New Issue
Block a user