Daniel P. Berrangé <[email protected]> writes:

> On Tue, Jan 13, 2026 at 10:16:06AM +0100, Markus Armbruster wrote:
>> Daniel P. Berrangé <[email protected]> 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 <[email protected]>
>> > Reviewed-by: Dr. David Alan Gilbert <[email protected]>
>> > Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
>> > Signed-off-by: Daniel P. Berrangé <[email protected]>

[...]

>> 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!

[...]


Reply via email to