diff options
author | Vicent Marti <tanoku@gmail.com> | 2012-10-01 17:59:04 +0200 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2012-10-01 17:59:04 +0200 |
commit | 93b5fabcc03e465609d0d68af13f4ab2cf1e2dfd (patch) | |
tree | 9962fc7f711cad649ff608b7fafedf676bfbbbf8 | |
parent | 9063be1f45287f945125315e7782745da8c1005d (diff) | |
download | libgit2-93b5fabcc03e465609d0d68af13f4ab2cf1e2dfd.tar.gz |
threads: Assert that the global state is initialized
-rw-r--r-- | src/global.c | 4 |
1 files changed, 4 insertions, 0 deletions
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; |