예제 #1
0
파일: global.c 프로젝트: DonkeyWs/libgit2
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;
}
예제 #2
0
파일: global.c 프로젝트: aep/libgit2
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;
}