Skip to main content

Module locks

Module locks 

Source
Expand description

Taking a lock whose holder may have panicked (api.md E15).

A panic while a Mutex is held, or an RwLock is held for writing, poisons it: std’s way of saying the value may be half-changed. What that means depends on what the lock guards, so coven takes each lock with the helper that says it.

  • lock_unpoisoned: every change made under the lock is whole before anything in it can panic, so a poisoned lock holds a whole value and is used as it is.
  • lock_or_abort: state the whole process shares, which a change can leave half-made. No store’s handle covers it, so the process ends.
  • coven-database’s lock_or_fail_handle: one open store’s state, which a change can leave half-made. That store’s handle fails, and every later call on it says so.

Functions§

into_unpoisoned
The value of mutex, whose value no panic can leave half-changed, as it goes.
lock_or_abort
Lock mutex, named what: state the whole process shares. A panic while it was held may have left it half-changed, and nothing narrower than the process can be failed for it, so the process ends.
lock_unpoisoned
Lock mutex, whose value no panic can leave half-changed.
read_unpoisoned
Read lock, whose value no panic can leave half-changed.
wait_unpoisoned
Wait on condvar with guard, the guard of a lock whose value no panic can leave half-changed.
write_unpoisoned
Write lock, whose value no panic can leave half-changed.