Explorar o código

Fix obviously-bogus locking

Samuel Thibault %!s(int64=12) %!d(string=hai) anos
pai
achega
06f7012d1b
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  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;