[sr-dev] [kamailio] core/futex: fix bug in futex_try (#520)

tsearle notifications at github.com
Thu Feb 25 09:56:25 CET 2016


atomic_cmpxchg returns the previous value.  If the previous value was 0 then it was previously unlocked and we now have acquired the lock.

Thus, it should  be c==0 that is considered as the case we enter the lock, not c!=0

As far as I can tell, lock_try (and lock_set_try) are currently no used anywhere in the code, so this fix shoudn't have any impact
You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/520

-- Commit Summary --

  * core/futex: fix bug in futex_try

-- File Changes --

    M futexlock.h (2)

-- Patch Links --

https://github.com/kamailio/kamailio/pull/520.patch
https://github.com/kamailio/kamailio/pull/520.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/520
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20160225/2829707b/attachment.html>


More information about the sr-dev mailing list