Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CancellableLock ¶
type CancellableLock struct {
// contains filtered or unexported fields
}
func NewCancellableLock ¶
func NewCancellableLock() *CancellableLock
func (*CancellableLock) Lock ¶
func (l *CancellableLock) Lock()
func (*CancellableLock) LockIfNotCancelled ¶
func (l *CancellableLock) LockIfNotCancelled(ctx context.Context) error
lockIfNotCancelled is attempting to take the lock but gives up if the context is cancelled This allows putting a time limit on the lock, as well as locking within a cancellable call lockIfNotCancelled returns an error if the ctx was cancelled (without taking the lock), otherwise returns nil user must call unlock to release the lock iif the error returned is nil
func (*CancellableLock) Unlock ¶
func (l *CancellableLock) Unlock()
Click to show internal directories.
Click to hide internal directories.