From 28c28ed275df2fd812bcdc75fdc04cdb6d9580b3 Mon Sep 17 00:00:00 2001 From: Craig Donner Date: Thu, 21 Jun 2018 11:13:57 +0100 Subject: [PATCH] Fix data races reported by TSAN. --- driver/others/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver/others/memory.c b/driver/others/memory.c index ed20cf5cd..7eff16ce3 100644 --- a/driver/others/memory.c +++ b/driver/others/memory.c @@ -543,9 +543,9 @@ static __inline struct alloc_t ** get_memory_table() { if (!local_memory_table_pos) { LOCK_COMMAND(&alloc_lock); local_memory_table_pos = next_memory_table_pos++; - UNLOCK_COMMAND(&alloc_lock); if (next_memory_table_pos > MAX_ALLOCATING_THREADS) printf("OpenBLAS : Program will terminate because you tried to start too many threads.\n"); + UNLOCK_COMMAND(&alloc_lock); # if !defined(HAS_COMPILER_TLS) # if defined(OS_WINDOWS) ::TlsSetValue(local_storage_key, (void*)local_memory_table_pos);