Przeglądaj źródła

Protect tags when they are notified of the termination of one of their deps.

Cédric Augonnet 16 lat temu
rodzic
commit
71646ef288
1 zmienionych plików z 9 dodań i 1 usunięć
  1. 9 1
      src/core/dependencies/tags.c

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

@@ -227,7 +227,15 @@ void notify_dependencies(struct job_s *j)
 
 		for (succ = 0; succ < nsuccs; succ++)
 		{
-			notify_cg(tag->succ[succ]);
+			struct _cg_t *cg = tag->succ[succ];
+
+			if (!cg->used_by_apps)
+				take_mutex(&cg->tag->lock);
+
+			notify_cg(cg);
+
+			if (!cg->used_by_apps)
+				release_mutex(&cg->tag->lock);
 		}
 
 		release_mutex(&tag->lock);