Package mutex implements the sync.Locker interface using x/sync/semaphore. It
may be used as a replacement for sync.Mutex when one or more goroutines need to
allow their calls to Lock to be cancelled by context cancellation.
TryLock acquires the mutex, blocking until resources are available or ctx is
done. On success, returns nil. On failure, returns ctx.Err() and leaves the
semaphore unchanged.
If ctx is already done, Acquire may still succeed without blocking.