Module: kamailio
Branch: master
Commit: 4a0856be3acd1c1a1eaaa058a39723a881fd6ed8
URL:
https://github.com/kamailio/kamailio/commit/4a0856be3acd1c1a1eaaa058a39723a…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-03-01T08:46:37+01:00
Merge pull request #520 from kamailio/tsearle-futex-try
core/futex: fix bug in futex_try
---
Modified: futexlock.h
---
Diff:
https://github.com/kamailio/kamailio/commit/4a0856be3acd1c1a1eaaa058a39723a…
Patch:
https://github.com/kamailio/kamailio/commit/4a0856be3acd1c1a1eaaa058a39723a…
---
diff --git a/futexlock.h b/futexlock.h
index 7aa7c73..db2fca4 100644
--- a/futexlock.h
+++ b/futexlock.h
@@ -142,7 +142,7 @@ static inline int futex_try(futex_lock_t* lock)
{
int c;
c=atomic_cmpxchg(lock, 0, 1);
- if (likely(c))
+ if (likely(c==0))
membar_enter_lock();
return c;
}