Commit 93b5fabc by Vicent Marti

threads: Assert that the global state is initialized

parent 9063be1f
...@@ -64,6 +64,8 @@ git_global_st *git__global_state(void) ...@@ -64,6 +64,8 @@ git_global_st *git__global_state(void)
{ {
void *ptr; void *ptr;
assert(_tls_init);
if ((ptr = TlsGetValue(_tls_index)) != NULL) if ((ptr = TlsGetValue(_tls_index)) != NULL)
return ptr; return ptr;
...@@ -105,6 +107,8 @@ git_global_st *git__global_state(void) ...@@ -105,6 +107,8 @@ git_global_st *git__global_state(void)
{ {
void *ptr; void *ptr;
assert(_tls_init);
if ((ptr = pthread_getspecific(_tls_key)) != NULL) if ((ptr = pthread_getspecific(_tls_key)) != NULL)
return ptr; return ptr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment