From: Jeff Hostetler Date: Sat, 18 Apr 2015 13:07:48 +0000 (-0400) Subject: Rename routine to free TLS data X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=06c985d8647a254000ed172fd888cc853a2c91dd;p=libgit2.git Rename routine to free TLS data --- diff --git a/src/global.c b/src/global.c index b5e4b5d00..f267fbd24 100644 --- a/src/global.c +++ b/src/global.c @@ -226,7 +226,7 @@ static void synchronized_threads_shutdown(void) /* Shut down any subsystems that have global state */ git__shutdown(); - git__free_thread_global_state(); + git__free_tls_data(); TlsFree(_tls_index); git_mutex_free(&git__mwindow_mutex); @@ -267,7 +267,12 @@ git_global_st *git__global_state(void) return ptr; } -void git__free_thread_global_state(void) +/** + * Free the TLS data associated with this thread. + * This should only be used by the thread as it + * is exiting. + */ +void git__free_tls_data(void) { void *ptr = TlsGetValue(_tls_index); if (!ptr) diff --git a/src/global.h b/src/global.h index 9d763b0c2..f56bec46c 100644 --- a/src/global.h +++ b/src/global.h @@ -32,6 +32,6 @@ typedef void (*git_global_shutdown_fn)(void); extern void git__on_shutdown(git_global_shutdown_fn callback); -extern void git__free_thread_global_state(void); +extern void git__free_tls_data(void); #endif diff --git a/src/win32/pthread.c b/src/win32/pthread.c index a6465d47f..a1cc18932 100644 --- a/src/win32/pthread.c +++ b/src/win32/pthread.c @@ -20,7 +20,7 @@ static DWORD WINAPI git_win32__threadproc(LPVOID lpParameter) thread->result = thread->proc(thread->param); - git__free_thread_global_state(); + git__free_tls_data(); return CLEAN_THREAD_EXIT; }