Ver código fonte

Fix obviously-bogus locking

Samuel Thibault 12 anos atrás
pai
commit
06f7012d1b
1 arquivos alterados com 1 adições e 2 exclusões
  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;