Daniel P. Berrangé <berrange@redhat.com> writes:
On Tue, Jan 13, 2026 at 10:16:06AM +0100, Markus Armbruster wrote:
Daniel P. Berrangé <berrange@redhat.com> writes:
The ability to set the thread name needs to be used in a number of places, so expose the current impls as public methods.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Dr. David Alan Gilbert <dave@treblig.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
[...]
This delays setting the thread name until the thread runs. Fine, I guess, but I'd mention it in the commit message.
Returning to this, the change is arguably /not/ delaying setting the thread name, but in fact fixing a race condition when settnig the thread name.
This existing 'set_thread_description' call is taking place in the parent thread, and at this point in the time the child thread has potentially already been scheduled to run. So if the parent thread was unscheduled, it is possible the child was running without having it name set. This change eliminates that race.
This distinction is important enough that I think I'll move this specific change out into its own self-contained commit.
Makes sense, thanks! [...]