diff options
Diffstat (limited to 'include/git2')
| -rw-r--r-- | include/git2/global.h | 38 | ||||
| -rw-r--r-- | include/git2/threads.h | 26 |
2 files changed, 38 insertions, 26 deletions
diff --git a/include/git2/global.h b/include/git2/global.h new file mode 100644 index 000000000..4f90c4c20 --- /dev/null +++ b/include/git2/global.h @@ -0,0 +1,38 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ +#ifndef INCLUDE_git_global_h__ +#define INCLUDE_git_global_h__ + +#include "common.h" + +GIT_BEGIN_DECL + +/** + * Init the global state + * + * This function must the called before any other libgit2 function in + * order to set up global state and threading. + * + * This function may be called multiple times. + * + * @return 0 or an error code + */ +GIT_EXTERN(int) git_libgit2_init(void); + +/** + * Shutdown the global state + * + * Clean up the global state and threading context after calling it as + * many times as `git_libgit2_init()` was called. + * + */ +GIT_EXTERN(void) git_libgit2_shutdown(void); + +/** @} */ +GIT_END_DECL +#endif + diff --git a/include/git2/threads.h b/include/git2/threads.h index 6b4287033..c0c3898d9 100644 --- a/include/git2/threads.h +++ b/include/git2/threads.h @@ -19,32 +19,6 @@ GIT_BEGIN_DECL /** - * Init the threading system. - * - * If libgit2 has been built with GIT_THREADS - * on, this function must be called once before - * any other library functions. - * - * If libgit2 has been built without GIT_THREADS - * support, this function is a no-op. - * - * @return 0 or an error code - */ -GIT_EXTERN(int) git_threads_init(void); - -/** - * Shutdown the threading system. - * - * If libgit2 has been built with GIT_THREADS - * on, this function must be called before shutting - * down the library. - * - * If libgit2 has been built without GIT_THREADS - * support, this function is a no-op. - */ -GIT_EXTERN(void) git_threads_shutdown(void); - -/** * Initialize the OpenSSL locks * * OpenSSL requires the application to determine how it performs |
