From fe6b51ae40313036436f81d4e87d232691cdacac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Sat, 1 Nov 2014 10:45:33 +0100 Subject: ssl: separate locking init from general init Extract the lock-setting functions into their own, as we cannot assume that it's ok for us to set this unconditionally. --- include/git2/threads.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include/git2/threads.h') diff --git a/include/git2/threads.h b/include/git2/threads.h index 11f89729a..6b4287033 100644 --- a/include/git2/threads.h +++ b/include/git2/threads.h @@ -44,6 +44,22 @@ GIT_EXTERN(int) git_threads_init(void); */ GIT_EXTERN(void) git_threads_shutdown(void); +/** + * Initialize the OpenSSL locks + * + * OpenSSL requires the application to determine how it performs + * locking. This is a convenience function which libgit2 provides for + * allocating and initializing the locks as well as setting the + * locking function to use the system's native locking functions. + * + * The locking function will be cleared and the memory will be freed + * when you call git_threads_sutdown(). + * + * @return 0 on success, -1 if there are errors or if libgit2 was not + * built with OpenSSL and threading support. + */ +GIT_EXTERN(int) git_openssl_set_locking(void); + /** @} */ GIT_END_DECL #endif -- cgit v1.2.1