Merge pull request #1634 from oon3m0oo/develop

Fix data races reported by TSAN.
This commit is contained in:
Martin Kroeker 2018-06-21 21:01:03 +02:00 committed by GitHub
commit cc66743b66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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);