Re: [PATCH] http.c: clear the 'finished' member once we are done with it

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Junio,

On Mon, 23 May 2022, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@xxxxxx> writes:
>
> > I suggested to replace the `finished` variable with an attribute (or
> > "field" or "member variable") of the slot, and to respect it when
> > looking for an unused slot, i.e. not only look for a slot whose
> > `in_use` is 0 but also require `reserved_for_use` to be 0. In essence,
> > the `run_active_slot()` function owns the slot, even if it is not
> > marked as `in_use`. That should address the same concern as baa7b67d
> > but without using a pointer to a local variable.
>
> Not really.  An outer run_active_slot() and an inner
> run_active_slot() have a pointer to the same slot object.

How is that possible? One of the first things that function does is to
assign `slot->finished = &finished`, and then run that `while (!finished)`
loop.

How would the outer `run_active_slot()` ever get signaled via `finished`
when the inner `run_active_slot()` would overwrite `slot->finished`? I am
puzzled why we do not see infinite loops in such outer calls all the time,
then.

Ciao,
Dscho




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux