diff options
| author | Carlos Martín Nieto <cmn@dwim.me> | 2014-11-01 10:45:33 +0100 |
|---|---|---|
| committer | Carlos Martín Nieto <cmn@dwim.me> | 2014-11-01 10:58:55 +0100 |
| commit | fe6b51ae40313036436f81d4e87d232691cdacac (patch) | |
| tree | b6f18e6eff58f684da5b5e561574dba417bdb0ff /include/git2/threads.h | |
| parent | e08365777199901d58e7cf4cc269ffabd07b2659 (diff) | |
| download | libgit2-fe6b51ae40313036436f81d4e87d232691cdacac.tar.gz | |
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.
Diffstat (limited to 'include/git2/threads.h')
| -rw-r--r-- | include/git2/threads.h | 16 |
1 files changed, 16 insertions, 0 deletions
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 |
