aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/utils/utils.h
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2013-06-11 15:51:50 +0200
committerMartin Willi <martin@revosec.ch>2013-06-11 15:54:27 +0200
commitd024a4652c6a791318e3b17b27006678315a7449 (patch)
tree56769e5b57f1b0d7ca12fedf03dd9cd017f0717a /src/libstrongswan/utils/utils.h
parent37a60cad3cfbf9ce98b6c76564f419fe884a1d71 (diff)
parent3568abe7be1efdd8d95b6711a552fefc8089fff8 (diff)
downloadstrongswan-d024a4652c6a791318e3b17b27006678315a7449.tar.bz2
strongswan-d024a4652c6a791318e3b17b27006678315a7449.tar.xz
Merge branch 'unique-sas'
Makes IKE_SA unique ID and CHILD_SA reqid counters atomic.
Diffstat (limited to 'src/libstrongswan/utils/utils.h')
-rw-r--r--src/libstrongswan/utils/utils.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libstrongswan/utils/utils.h b/src/libstrongswan/utils/utils.h
index ff1a007c1..8cc48513b 100644
--- a/src/libstrongswan/utils/utils.h
+++ b/src/libstrongswan/utils/utils.h
@@ -661,7 +661,7 @@ typedef volatile u_int refcount_t;
#ifdef HAVE_GCC_ATOMIC_OPERATIONS
-#define ref_get(ref) {__sync_fetch_and_add(ref, 1); }
+#define ref_get(ref) __sync_add_and_fetch(ref, 1)
#define ref_put(ref) (!__sync_sub_and_fetch(ref, 1))
#define cas_bool(ptr, oldval, newval) \
@@ -677,8 +677,9 @@ typedef volatile u_int refcount_t;
* Increments the reference counter atomic.
*
* @param ref pointer to ref counter
+ * @return new value of ref
*/
-void ref_get(refcount_t *ref);
+refcount_t ref_get(refcount_t *ref);
/**
* Put back a unused reference.