type Lock struct {
// contains filtered or unexported fields
}
Lock encapsulates the channel used to provide locking and unlocking capabilities. We don't want this channel
exposed as someone may interact with it in malicious ways.
New creates a Lock and populates its channel. Once constructed, callers can use the Lock(ctx) method to lock a
portion of code. Unlike the sync.Mutex implementation, this allows a Lock operation to be deadlined or cancelled
using the provided context.
Lock attempts to obtain the lock given the provided context. This call can be time-bound using the
context.WithDeadline method call to decorate the context with a halting point.