View Source Mutex.Lock (Mutex v2.0.0)

This module defines a struct containing the key(s) locked with all the locking functions in Mutex.

Summary

Types

t()

The struct containing the key(s) locked during a lock operation. :type specifies wether there is one or more keys.

Functions

Returns the metadata associated with the lock. The metadata is given to the mutex on initialization

Types

@type t() :: %Mutex.Lock{
  key: nil | Mutex.key(),
  keys: nil | [Mutex.key()],
  meta: any(),
  type: :single | :multi
}

The struct containing the key(s) locked during a lock operation. :type specifies wether there is one or more keys.

Functions

@spec get_meta(lock :: t()) :: any()

Returns the metadata associated with the lock. The metadata is given to the mutex on initialization:

Mutex.start_link(name: MyMutex, meta: metadata)