The "race condition" here is the question of which thread the runnable
destructor runs on.  If the executing thread is already shut down the
destructor still runs on the "wrong" dispatching thread (or not at
all).  Since the point of fixing the original race is to guarantee
that the destructor runs on the executing thread it's useful to
consider this an extension of the original race.

- Kyle

On Mon, Jan 4, 2016 at 10:39 PM, Ting-Yu Chou <tc...@mozilla.com> wrote:
>
>> In bug 1218297 we saw a case where dispatch to a thread (the socket
>> transport service thread in this case) fails because the thread has
>> already shut down.  In our brave new world, nsThread simply leaks the
>> runnable.  It can't release the reference it holds, because that would
>> reintroduce the race condition we wanted to avoid, and it can't
>> release the reference on the correct thread so it's already gone away.
>
>
> I am a bit confused with this, if the executing thread has already shut
> down,
> why would releasing the reference dispatching thread holds reintroduce the
> race
> condition? Who is racing with dispatching thread?
>
> Ting
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to