static int synchronized_threads_init(void) { int error; _tls_index = TlsAlloc(); if (git_mutex_init(&git__mwindow_mutex)) return -1; /* Initialize any other subsystems that have global state */ if ((error = git_hash_global_init()) >= 0) error = git_sysdir_global_init(); win32_pthread_initialize(); return error; }
int git_threads_init(void) { int error; if (_tls_init) return 0; _tls_index = TlsAlloc(); if (git_mutex_init(&git__mwindow_mutex)) return -1; /* Initialize any other subsystems that have global state */ if ((error = git_hash_global_init()) >= 0 && (error = git_futils_dirs_global_init()) >= 0) _tls_init = 1; GIT_MEMORY_BARRIER; win32_pthread_initialize(); return error; }