Description

See lock_hash in h_table.c:

void lock_hash(int i)
{
    int mypid;

    mypid = my_pid();
    if (likely(atomic_get(&_tm_table->entries[i].locker_pid) != mypid)) {
        lock(&_tm_table->entries[i].mutex);
        atomic_set(&_tm_table->entries[i].locker_pid, mypid);
    } else {
        /* locked within the same process that called us*/
        _tm_table->entries[i].rec_lock_level++;
    }
}

Flowing lines of code do not guarantee atomicity and I think it is not safe:

Would you mind solving my confusion?


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <kamailio/kamailio/issues/3083@github.com>