Commit 5c5374526d for aom
commit 5c5374526da42627e92621878af458c25f2121be
Author: Wan-Teh Chang <wtc@google.com>
Date: Mon Apr 6 10:51:02 2026 -0700
Add comment on incrementing p_mt_info->num_workers
In av1_create_workers(), it is important to increment
p_mt_info->num_workers in the for loop that creates the worker threads,
so that av1_terminate_workers() still works after a partial failure.
Add a comment to explain this.
Change-Id: I55c7fa341d32b577c89104733cbe8da78a8a0d76
diff --git a/av1/encoder/ethread.c b/av1/encoder/ethread.c
index 636a4186fb..0422856985 100644
--- a/av1/encoder/ethread.c
+++ b/av1/encoder/ethread.c
@@ -1117,6 +1117,8 @@ void av1_create_workers(AV1_PRIMARY *ppi, int num_workers) {
}
winterface->sync(worker);
+ // Ensure p_mt_info->num_workers is the number of threads successfuly
+ // created. Important to av1_terminate_workers().
++p_mt_info->num_workers;
}
}