Berkeley DB Programmer's Reference: Locking Subsystem
Berkeley DB Programmer's Reference: Locking Subsystem
Standard lock modes
The include file #include <db.h> declares two commonly used conflict arrays:
-
const u_int8_t db_lock_rw_conflicts[ ];
- This is a conflict array for a simple scheme using shared and exclusive
lock modes.
-
const u_int8_t db_lock_riw_conflicts[ ];
- This is a conflict array that involves various intent lock modes (e.g.,
intent shared) that are used for multigranularity locking.
Their associated sizes are DB_LOCK_RW_N and DB_LOCK_RIW_N.
In addition, the include file #include <db.h> defines the type
db_lockmode_t, which is the type of the lock modes used
with the standard tables above:
- DB_LOCK_NG
- not granted (always 0)
- DB_LOCK_READ
- read (shared)
- DB_LOCK_WRITE
- write (exclusive)