From 93b5fabcc03e465609d0d68af13f4ab2cf1e2dfd Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Mon, 1 Oct 2012 17:59:04 +0200 Subject: [PATCH] threads: Assert that the global state is initialized --- src/global.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/global.c b/src/global.c index 691f0d4f6..22127faf7 100644 --- a/src/global.c +++ b/src/global.c @@ -64,6 +64,8 @@ git_global_st *git__global_state(void) { void *ptr; + assert(_tls_init); + if ((ptr = TlsGetValue(_tls_index)) != NULL) return ptr; @@ -105,6 +107,8 @@ git_global_st *git__global_state(void) { void *ptr; + assert(_tls_init); + if ((ptr = pthread_getspecific(_tls_key)) != NULL) return ptr;