Skip to content

Commit

Permalink
git__mwindow_mutex needs to be initialized even with pthreads
Browse files Browse the repository at this point in the history
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()
  • Loading branch information
jspahrsummers committed Dec 9, 2012
1 parent 0249a50 commit c3320ac
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/global.c
Expand Up @@ -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 */
Expand All @@ -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();
Expand Down

0 comments on commit c3320ac

Please sign in to comment.