mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-08-31 01:35:56 +08:00
ctxlock
Minimal Go read-write-lock with context-cancellation support.
Usage is like symc.RWMutex:
- the
Lockmust not be copied Lock()/Unlock()for write lockingRLock()/RUnlock()for read lockingLockCtx(ctx) errorfor write locking with cancellationRLockCtx(ctx) errorfor read locking with cancellation- panics on invalid usage (unlocks when not locked, or unlock type not matching lock type)
License
MIT, see LICENSE file.