[sr-dev] The recursive lock of tm module is not safe?

progrom progrom at foxmail.com
Wed Apr 13 15:45:52 CEST 2022


Hi:

See lock_hash in h_table.c:

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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20220413/5f4ea17d/attachment.htm>


More information about the sr-dev mailing list