Browse Source

Fix obviously-bogus locking

Samuel Thibault 12 years ago
parent
commit
06f7012d1b
1 changed files with 1 additions and 2 deletions
  1. 1 2
      src/datawizard/memalloc.c

+ 1 - 2
src/datawizard/memalloc.c

@@ -543,10 +543,9 @@ static size_t flush_memchunk_cache(unsigned node, size_t reclaim)
 		free(mc->chunk_interface);
 		_starpu_mem_chunk_delete(mc);
 
+		_STARPU_PTHREAD_RWLOCK_WRLOCK(&mc_rwlock[node]);
 		if (reclaim && freed>reclaim)
 			break;
-
-		_STARPU_PTHREAD_RWLOCK_WRLOCK(&mc_rwlock[node]);
 	}
 	_STARPU_PTHREAD_RWLOCK_UNLOCK(&mc_rwlock[node]);
 	return freed;