1 /* 2 * Copyright (C) the libgit2 contributors. All rights reserved. 3 * 4 * This file is part of libgit2, distributed under the GNU GPL v2 with 5 * a Linking Exception. For full terms see the included COPYING file. 6 */ 7 #ifndef INCLUDE_git_openssl_h__ 8 #define INCLUDE_git_openssl_h__ 9 10 #include "git2/common.h" 11 12 GIT_BEGIN_DECL 13 14 /** 15 * Initialize the OpenSSL locks 16 * 17 * OpenSSL requires the application to determine how it performs 18 * locking. 19 * 20 * This is a last-resort convenience function which libgit2 provides for 21 * allocating and initializing the locks as well as setting the 22 * locking function to use the system's native locking functions. 23 * 24 * The locking function will be cleared and the memory will be freed 25 * when you call git_threads_sutdown(). 26 * 27 * If your programming language has an OpenSSL package/bindings, it 28 * likely sets up locking. You should very strongly prefer that over 29 * this function. 30 * 31 * @return 0 on success, -1 if there are errors or if libgit2 was not 32 * built with OpenSSL and threading support. 33 */ 34 GIT_EXTERN(int) git_openssl_set_locking(void); 35 36 GIT_END_DECL 37 #endif 38 39