summaryrefslogtreecommitdiff
path: root/lib/locks.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/locks.c')
-rw-r--r--lib/locks.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/locks.c b/lib/locks.c
index 3c05e4d988..146a806132 100644
--- a/lib/locks.c
+++ b/lib/locks.c
@@ -117,3 +117,12 @@ gnutls_rwlock_unlock(gnutls_rwlock_t rwlock)
}
return 0;
}
+
+int
+gnutls_once(gnutls_once_t once, void (*init_func) (void))
+{
+ if (unlikely(glthread_once(once, init_func))) {
+ return gnutls_assert_val(GNUTLS_E_LOCKING_ERROR);
+ }
+ return 0;
+}