Przeglądaj źródła

While removing a tag, protect the hierarchical table on the one hand, and the
tag structure itself on the other hand.

Cédric Augonnet 17 lat temu
rodzic
commit
841dee46ef
1 zmienionych plików z 6 dodań i 1 usunięć
  1. 6 1
      src/core/dependencies/tags.c

+ 6 - 1
src/core/dependencies/tags.c

@@ -86,14 +86,19 @@ void starpu_tag_remove(starpu_tag_t id)
 	struct tag_s *tag;
 	struct tag_s *tag;
 
 
 	take_mutex(&tag_mutex);
 	take_mutex(&tag_mutex);
+
 	tag = htbl_remove_tag(tag_htbl, id);
 	tag = htbl_remove_tag(tag_htbl, id);
+
+	release_mutex(&tag_mutex);
+
+	take_mutex(&tag->lock);
 	
 	
 #ifdef DYNAMIC_DEPS_SIZE
 #ifdef DYNAMIC_DEPS_SIZE
 	if (tag)
 	if (tag)
 		free(tag->succ);
 		free(tag->succ);
 #endif
 #endif
 
 
-	release_mutex(&tag_mutex);
+	release_mutex(&tag->lock);
 
 
 	free(tag);
 	free(tag);
 }
 }