diff options
author | Russell Belfer <rb@github.com> | 2013-08-26 14:56:31 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-08-26 14:56:31 -0700 |
commit | 430953417f74dfcdbe030bafc069e1c07edceeb6 (patch) | |
tree | b8276cc0ec5e481307202ec00ef7abcade6e9d98 /src/global.c | |
parent | 44d655318661affa2feb51e9d6d533bb16d7f2b5 (diff) | |
download | libgit2-430953417f74dfcdbe030bafc069e1c07edceeb6.tar.gz |
Load SRWLock APIs at runtime
This loads SRWLock APIs at runtime and in their absence (i.e. on
Windows before Vista) falls back on a regular CRITICAL_SECTION
that will not permit concurrent readers.
Diffstat (limited to 'src/global.c')
-rw-r--r-- | src/global.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/global.c b/src/global.c index a06d0c81f..b504e5e0a 100644 --- a/src/global.c +++ b/src/global.c @@ -71,18 +71,22 @@ int git_threads_init(void) GIT_MEMORY_BARRIER; + win32_pthread_initialize(); + return error; } void git_threads_shutdown(void) { + /* Shut down any subsystems that have global state */ + win32_pthread_shutdown(); + git_futils_dirs_free(); + git_hash_global_shutdown(); + TlsFree(_tls_index); _tls_init = 0; - git_mutex_free(&git__mwindow_mutex); - /* Shut down any subsystems that have global state */ - git_hash_global_shutdown(); - git_futils_dirs_free(); + git_mutex_free(&git__mwindow_mutex); } git_global_st *git__global_state(void) |