Module v11::context[][src]

Ergonomics for juggling multiple locks.

v11 code involving many table locks can encounter two problems:

  1. A higher function may have a write lock, and some lower function also needs a write locking, resulting in a dead-lock.
  2. Passing many locks around is unwieldy, but must be done in tight for loops.

You could create context structs manually, but this is labor-intensive, especially when you start needing to combine them.

This module introduces context! to help with this.

Traits

Lockable

This trait indicates a type that can be locked by context!.