### Description
See `lock_hash` in `h_table.c`:
```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:
* atomic_get(&_tm_table->entries[i].locker_pid) != mypid
* lock(&_tm_table->entries[i].mutex)
* atomic_set(&_tm_table->entries[i].locker_pid, mypid)
Would you mind solving my confusion?
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3083
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3083(a)github.com>