XMMS2
Lock

Locks entries so only one transaction can use tham at a time. More...

Functions

s4_lock_t_lock_alloc ()
void _lock_free (s4_lock_t *lock)
int _lock_exclusive (s4_lock_t *lock, s4_transaction_t *trans)
int _lock_shared (s4_lock_t *lock, s4_transaction_t *trans)
void _lock_unlock_all (s4_transaction_t *trans)

Detailed Description

Locks entries so only one transaction can use tham at a time.

Locks can be locked in three ways, read-only, upgradable and exclusive.

  • Read-only is for read-only transactions that know they will not want an exclusive version of the lock later one
  • Upgradable is for transactions that might want to upgrade it to an exclusive lock later on.
  • Exclusive locks can only be held by one transaction.

Function Documentation

◆ _lock_alloc()

s4_lock_t * _lock_alloc ( void )

Referenced by _index_create().

◆ _lock_exclusive()

int _lock_exclusive ( s4_lock_t * lock,
s4_transaction_t * trans )

Referenced by _index_lock_exclusive().

◆ _lock_free()

void _lock_free ( s4_lock_t * lock)

Referenced by _free_relations(), and _index_free().

◆ _lock_shared()

int _lock_shared ( s4_lock_t * lock,
s4_transaction_t * trans )

Referenced by _index_lock_shared().

◆ _lock_unlock_all()

void _lock_unlock_all ( s4_transaction_t * trans)

Referenced by _transaction_dummy_free().