diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2014-10-23 17:34:41 +0200 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2014-11-07 21:36:40 +0100 |
commit | bc540ff79173b3182206db5eb322048626b81119 (patch) | |
tree | 4b2cb3c08f07ff7062dc1a033b4554a79bd418b8 /src | |
parent | 4e1b3b3b7186b017223b8302a51289ff92ccba25 (diff) | |
download | libgit2-cmn/global-init.tar.gz |
Rename git_threads_ to git_libgit2_cmn/global-init
This describes their purpose better, as we now initialize ssl and some
other global stuff in there. Calling the init function is not something
which has been optional for a while now.
Diffstat (limited to 'src')
-rw-r--r-- | src/global.c | 18 | ||||
-rw-r--r-- | src/hash/hash_win32.c | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/global.c b/src/global.c index 3c91860cd..296be86c7 100644 --- a/src/global.c +++ b/src/global.c @@ -133,7 +133,7 @@ int git_openssl_set_locking(void) * Handle the global state with TLS * * If libgit2 is built with GIT_THREADS enabled, - * the `git_threads_init()` function must be called + * the `git_libgit2_init()` function must be called * before calling any other function of the library. * * This function allocates a TLS index (using pthreads @@ -156,9 +156,9 @@ int git_openssl_set_locking(void) */ /* - * `git_threads_init()` allows subsystems to perform global setup, + * `git_libgit2_init()` allows subsystems to perform global setup, * which may take place in the global scope. An explicit memory - * fence exists at the exit of `git_threads_init()`. Without this, + * fence exists at the exit of `git_libgit2_init()`. Without this, * CPU cores are free to reorder cache invalidation of `_tls_init` * before cache invalidation of the subsystems' newly written global * state. @@ -185,7 +185,7 @@ static int synchronized_threads_init(void) return error; } -int git_threads_init(void) +int git_libgit2_init(void) { int error = 0; @@ -210,7 +210,7 @@ static void synchronized_threads_shutdown(void) git_mutex_free(&git__mwindow_mutex); } -void git_threads_shutdown(void) +void git_libgit2_shutdown(void) { /* Enter the lock */ while (InterlockedCompareExchange(&_mutex, 1, 0)) { Sleep(0); } @@ -272,14 +272,14 @@ static void init_once(void) GIT_MEMORY_BARRIER; } -int git_threads_init(void) +int git_libgit2_init(void) { pthread_once(&_once_init, init_once); git_atomic_inc(&git__n_inits); return init_error; } -void git_threads_shutdown(void) +void git_libgit2_shutdown(void) { void *ptr = NULL; pthread_once_t new_once = PTHREAD_ONCE_INIT; @@ -320,7 +320,7 @@ git_global_st *git__global_state(void) static git_global_st __state; -int git_threads_init(void) +int git_libgit2_init(void) { static int ssl_inited = 0; @@ -333,7 +333,7 @@ int git_threads_init(void) return 0; } -void git_threads_shutdown(void) +void git_libgit2_shutdown(void) { /* Shut down any subsystems that have global state */ if (0 == git_atomic_dec(&git__n_inits)) diff --git a/src/hash/hash_win32.c b/src/hash/hash_win32.c index bb2231364..6bae53e55 100644 --- a/src/hash/hash_win32.c +++ b/src/hash/hash_win32.c @@ -236,7 +236,7 @@ int git_hash_ctx_init(git_hash_ctx *ctx) /* * When compiled with GIT_THREADS, the global hash_prov data is - * initialized with git_threads_init. Otherwise, it must be initialized + * initialized with git_libgit2_init. Otherwise, it must be initialized * at first use. */ if (hash_prov.type == INVALID && (error = git_hash_global_init()) < 0) |