Move the memory barrier to the allocation loop

This commit is contained in:
Martin Kroeker 2020-04-10 14:11:37 +02:00 committed by GitHub
parent 79cb24dc10
commit eb0ae9e711
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -2716,6 +2716,7 @@ void *blas_memory_alloc(int procpos){
#if (defined(SMP) || defined(USE_LOCKING)) && !defined(USE_OPENMP) #if (defined(SMP) || defined(USE_LOCKING)) && !defined(USE_OPENMP)
LOCK_COMMAND(&alloc_lock); LOCK_COMMAND(&alloc_lock);
#endif #endif
WMB;
do { do {
#if defined(USE_OPENMP) #if defined(USE_OPENMP)
if (!memory[position].used) { if (!memory[position].used) {
@ -2740,7 +2741,7 @@ void *blas_memory_alloc(int procpos){
#ifdef DEBUG #ifdef DEBUG
printf(" Position -> %d\n", position); printf(" Position -> %d\n", position);
#endif #endif
WMB; // WMB; not sure if this is required here ?
memory[position].used = 1; memory[position].used = 1;
#if (defined(SMP) || defined(USE_LOCKING)) && !defined(USE_OPENMP) #if (defined(SMP) || defined(USE_LOCKING)) && !defined(USE_OPENMP)
UNLOCK_COMMAND(&alloc_lock); UNLOCK_COMMAND(&alloc_lock);