diff options
Diffstat (limited to 'src/libstrongswan/utils/utils.c')
-rw-r--r-- | src/libstrongswan/utils/utils.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libstrongswan/utils/utils.c b/src/libstrongswan/utils/utils.c index aa59f4a4d..30084cd81 100644 --- a/src/libstrongswan/utils/utils.c +++ b/src/libstrongswan/utils/utils.c @@ -466,11 +466,15 @@ static pthread_mutex_t ref_mutex = PTHREAD_MUTEX_INITIALIZER; /** * Increase refcount */ -void ref_get(refcount_t *ref) +refcount_t ref_get(refcount_t *ref) { + refcount_t current; + pthread_mutex_lock(&ref_mutex); - (*ref)++; + current = ++(*ref); pthread_mutex_unlock(&ref_mutex); + + return current; } /** |