summaryrefslogtreecommitdiff
path: root/src/global.c
diff options
context:
space:
mode:
authorJustin Spahr-Summers <Justin.SpahrSummers@gmail.com>2012-12-09 02:22:50 -0800
committerJustin Spahr-Summers <Justin.SpahrSummers@gmail.com>2012-12-09 02:22:50 -0800
commitc3320aca7640386a2cfc0c785560ff4d36851ef9 (patch)
tree1c00d844990bf83797b4b36493a8981f60cce5dd /src/global.c
parent0249a5032ef6fc27d1f2b974aafdb38ab61f81bc (diff)
downloadlibgit2-c3320aca7640386a2cfc0c785560ff4d36851ef9.tar.gz
git__mwindow_mutex needs to be initialized even with pthreads
This could also use PTHREAD_MUTEX_INITIALIZER, but a dynamic initializer seems like a more portable concept, and we won't need another #define on top of git_mutex_init()
Diffstat (limited to 'src/global.c')
-rw-r--r--src/global.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/global.c b/src/global.c
index d085089c3..305ec2edd 100644
--- a/src/global.c
+++ b/src/global.c
@@ -119,6 +119,7 @@ int git_threads_init(void)
if (_tls_init)
return 0;
+ git_mutex_init(&git__mwindow_mutex);
pthread_key_create(&_tls_key, &cb__free_status);
/* Initialize any other subsystems that have global state */
@@ -134,6 +135,7 @@ void git_threads_shutdown(void)
{
pthread_key_delete(_tls_key);
_tls_init = 0;
+ git_mutex_free(&git__mwindow_mutex);
/* Shut down any subsystems that have global state */
git_hash_global_shutdown();