hslot.h File Reference

USRLOC - Hash table collision slot related functions. More...

#include "../../locking.h"
#include "udomain.h"
#include "urecord.h"

Include dependency graph for hslot.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  hslot

Typedefs

typedef struct hslot hslot_t

Functions

void deinit_slot (hslot_t *_s)
 Deinitialize given slot structure.
void init_slot (struct udomain *_d, hslot_t *_s, int n)
 Initialize slot structure.
void slot_add (hslot_t *_s, struct urecord *_r)
 Add an element to slot linked list.
void slot_rem (hslot_t *_s, struct urecord *_r)
 Remove an element from slot linked list.
void ul_destroy_locks (void)
 Destroy all locks on the list.
int ul_init_locks (void)
 Initialize locks for the hash table.
void ul_lock_idx (int idx)
 Lock a lock with a certain index.
void ul_release_idx (int idx)
 Release a lock with a certain index.
void ul_unlock_locks (void)
 Destroy all locks on the list.


Detailed Description

USRLOC - Hash table collision slot related functions.

Definition in file hslot.h.


Typedef Documentation

typedef struct hslot hslot_t


Function Documentation

void deinit_slot ( hslot_t _s  ) 

Deinitialize given slot structure.

Parameters:
_s hash slot

Definition at line 148 of file hslot.c.

References hslot::d, hslot::first, free_urecord(), hslot::last, hslot::n, and urecord::next.

Referenced by free_udomain().

void init_slot ( struct udomain _d,
hslot_t _s,
int  n 
)

Initialize slot structure.

Initialize slot structure.

Parameters:
_d domain for the hash slot
_s hash slot
n used to get the slot number (modulo number or locks)

Definition at line 129 of file hslot.c.

References hslot::d, hslot::first, hslot::last, hslot::lockidx, hslot::n, ul_locks, and ul_locks_no.

Referenced by new_udomain().

void slot_add ( hslot_t _s,
struct urecord _r 
)

Add an element to slot linked list.

Add an element to slot linked list.

Parameters:
_s hash slot
_r added record

Definition at line 170 of file hslot.c.

References hslot::first, hslot::last, hslot::n, urecord::next, urecord::prev, and urecord::slot.

Referenced by mem_insert_urecord().

void slot_rem ( hslot_t _s,
struct urecord _r 
)

Remove an element from slot linked list.

Parameters:
_s hash slot
_r removed record

Definition at line 189 of file hslot.c.

References hslot::first, hslot::last, hslot::n, urecord::next, urecord::prev, and urecord::slot.

Referenced by mem_delete_urecord().

void ul_destroy_locks ( void   ) 

Destroy all locks on the list.

Definition at line 94 of file hslot.c.

References ul_locks.

int ul_init_locks ( void   ) 

Initialize locks for the hash table.

Returns:
0 on success, -1 on failure

Definition at line 44 of file hslot.c.

References LM_ERR, LM_INFO, ul_locks, and ul_locks_no.

Referenced by mod_init().

void ul_lock_idx ( int  idx  ) 

Lock a lock with a certain index.

Parameters:
idx lock index

Definition at line 107 of file hslot.c.

References ul_locks.

Referenced by lock_udomain(), and lock_ulslot().

void ul_release_idx ( int  idx  ) 

Release a lock with a certain index.

Parameters:
idx lock index

Definition at line 117 of file hslot.c.

References ul_locks.

Referenced by ul_unlock_locks(), unlock_udomain(), and unlock_ulslot().

void ul_unlock_locks ( void   ) 

Destroy all locks on the list.

Definition at line 74 of file hslot.c.

References ul_locks, ul_locks_no, and ul_release_idx().


Generated on Wed May 23 06:01:04 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6