Browse Source

Restore some unconditional locks from 0.2.19

pull/1465/head
Martin Kroeker GitHub 8 years ago
parent
commit
6fb5b73320
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 17 deletions
  1. +12
    -17
      driver/others/memory.c

+ 12
- 17
driver/others/memory.c View File

@@ -1016,9 +1016,7 @@ void *blas_memory_alloc(int procpos){
};
void *(**func)(void *address);

#if defined(SMP) && !defined(USE_OPENMP)
LOCK_COMMAND(&alloc_lock);
#endif

if (!memory_initialized) {

@@ -1052,9 +1050,7 @@ void *blas_memory_alloc(int procpos){
memory_initialized = 1;

}
#if defined(SMP) && !defined(USE_OPENMP)
UNLOCK_COMMAND(&alloc_lock);
#endif

#ifdef DEBUG
printf("Alloc Start ...\n");
@@ -1071,14 +1067,15 @@ void *blas_memory_alloc(int procpos){
if (!memory[position].used && (memory[position].pos == mypos)) {
#if defined(SMP) && !defined(USE_OPENMP)
LOCK_COMMAND(&alloc_lock);
#endif
/* blas_lock(&memory[position].lock);*/
#else
blas_lock(&memory[position].lock);
#endif
if (!memory[position].used) goto allocation;
#if defined(SMP) && !defined(USE_OPENMP)
UNLOCK_COMMAND(&alloc_lock);
#else
blas_unlock(&memory[position].lock);
#endif
/* blas_unlock(&memory[position].lock);*/
}

position ++;
@@ -1094,14 +1091,15 @@ void *blas_memory_alloc(int procpos){
/* if (!memory[position].used) { */
#if defined(SMP) && !defined(USE_OPENMP)
LOCK_COMMAND(&alloc_lock);
#endif
/* blas_lock(&memory[position].lock);*/
#else
blas_lock(&memory[position].lock);
#endif
if (!memory[position].used) goto allocation;
#if defined(SMP) && !defined(USE_OPENMP)
UNLOCK_COMMAND(&alloc_lock);
#endif
/* blas_unlock(&memory[position].lock);*/
#else
blas_unlock(&memory[position].lock);
#endif
/* } */

position ++;
@@ -1190,9 +1188,7 @@ void *blas_memory_alloc(int procpos){

if (memory_initialized == 1) {

#if defined(SMP) && !defined(USE_OPENMP)
LOCK_COMMAND(&alloc_lock);
#endif

if (memory_initialized == 1) {

@@ -1201,9 +1197,8 @@ void *blas_memory_alloc(int procpos){
memory_initialized = 2;
}

#if defined(SMP) && !defined(USE_OPENMP)
UNLOCK_COMMAND(&alloc_lock);
#endif
}
#endif



Loading…
Cancel
Save