Beispiel #1
0
/*!
 * \brief  Get lock for a slot
 * \param _d domain
 * \param i slot number
 */
void lock_ulslot(udomain_t* _d, int i) {
#ifdef GEN_LOCK_T_PREFERED
    lock_get(_d->table[i].lock);
#else
    ul_lock_idx(_d->table[i].lockidx);
#endif
}
Beispiel #2
0
/*
 * Get lock
 */
void lock_shvar(sh_var_t *shv)
{
	if(shv==NULL)
		return;
#ifdef GEN_LOCK_T_PREFERED
	lock_get(shv->lock);
#else
	ul_lock_idx(shv->lockidx);
#endif
}
Beispiel #3
0
void lock_udomain(udomain_t* _d, str* _aor)
{
	unsigned int sl;
	sl = core_hash(_aor, 0, _d->size);

#ifdef GEN_LOCK_T_PREFERED
	lock_get(_d->table[sl].lock);
#else
	ul_lock_idx(_d->table[sl].lockidx);
#endif
}
Beispiel #4
0
void lock_udomain(udomain_t* _d, str* _aor)
{
	unsigned int sl;

	sl = get_hash_slot(_d, _aor);

#ifdef GEN_LOCK_T_PREFERED
	lock_get(_d->table[sl].lock);
#else
	ul_lock_idx(_d->table[sl].lockidx);
#endif
}
Beispiel #5
0
void lock_udomain(udomain_t* _d, str* _aor, str* _received_host, unsigned short received_port)
{
	unsigned int sl;
	
	sl = get_hash_slot(_d, _aor, _received_host, received_port);

#ifdef GEN_LOCK_T_PREFERED
	lock_get(_d->table[sl].lock);
#else
	ul_lock_idx(_d->table[sl].lockidx);
#endif
}
Beispiel #6
0
/*!
 * \brief Get lock for a domain
 * \param _d domain
 * \param _aor adress of record, used as hash source for the lock slot
 */
void lock_udomain(udomain_t* _d, str* _aor) {
    unsigned int sl;
    sl = core_hash(_aor, 0, _d->size);
#ifdef EXTRA_DEBUG
    LM_DBG("LOCKING UDOMAIN SLOT [%d]\n", sl);
#endif

#ifdef GEN_LOCK_T_PREFERED
    lock_get(_d->table[sl].lock);
#else
    ul_lock_idx(_d->table[sl].lockidx);
#endif
}
Beispiel #7
0
/*!
 * \brief Get lock for a domain
 * \param _d domain
 * \param _aor adress of record, used as hash source for the lock slot
 */
void lock_udomain(udomain_t* _d, str* _aor)
{
    unsigned int sl;
    if (db_mode!=DB_ONLY)
    {
        sl = ul_get_aorhash(_aor) & (_d->size - 1);
#ifdef GEN_LOCK_T_PREFERED
        lock_get(_d->table[sl].lock);
#else
        ul_lock_idx(_d->table[sl].lockidx);
#endif
    }
}