Skip to content

Commit cc66743

Browse files
authored
Merge pull request #1634 from oon3m0oo/develop
Fix data races reported by TSAN.
2 parents 2aa0a58 + 28c28ed commit cc66743

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

driver/others/memory.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,9 +543,9 @@ static __inline struct alloc_t ** get_memory_table() {
543543
if (!local_memory_table_pos) {
544544
LOCK_COMMAND(&alloc_lock);
545545
local_memory_table_pos = next_memory_table_pos++;
546-
UNLOCK_COMMAND(&alloc_lock);
547546
if (next_memory_table_pos > MAX_ALLOCATING_THREADS)
548547
printf("OpenBLAS : Program will terminate because you tried to start too many threads.\n");
548+
UNLOCK_COMMAND(&alloc_lock);
549549
# if !defined(HAS_COMPILER_TLS)
550550
# if defined(OS_WINDOWS)
551551
::TlsSetValue(local_storage_key, (void*)local_memory_table_pos);

0 commit comments

Comments
 (0)