From a51c18000cdf4e623d4a46246bcc6d5b1f47e917 Mon Sep 17 00:00:00 2001
From: SoniEx2 <endermoneymod@gmail.com>
Date: Thu, 20 Jan 2022 20:45:16 -0300
Subject: Fix data race

---
 ganarchy/cli/run_targets.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ganarchy/cli/run_targets.py b/ganarchy/cli/run_targets.py
index 53e1b0f..eb3fb0c 100644
--- a/ganarchy/cli/run_targets.py
+++ b/ganarchy/cli/run_targets.py
@@ -141,7 +141,7 @@ def run_once(out, n_threads, keep_stale_projects):
     with core.GIT.with_work_repos(n_threads) as work_repos:
         threads = []
         for i, work_repo in enumerate(work_repos):
-            t = threading.Thread(target=lambda: run_thread(i, work_repo), name="ganarchy-fetch-{}".format(i))
+            t = threading.Thread(target=lambda i=i, work_repo=work_repo: run_thread(i, work_repo), name="ganarchy-fetch-{}".format(i))
             t.start()
             threads.append(t)
         for t in threads:
-- 
cgit 1.4.1