[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: To-be-closed variables and coroutines
- From: Dibyendu Majumdar <mobile@...>
- Date: Fri, 31 Jul 2020 18:53:23 +0100
On Fri, 31 Jul 2020 at 11:13, Mimmo Mane <pocomane_7a@pocomane.com> wrote:
>
> Just to be clear, I am not fully sure what the "Right" behaviour
> should be. I was just puzzled by Dibyendu's statement that the defer
> patch behaves differently in this case. I also wrote a different defer
> patch [5] and it behaves the same.
>
Hi, I did not mean to say that the 'defer' patch solves it.
All I was saying is that the 'defer' statement makes less promises as
it makes it more explicit that some code (it can anything) will be
executed when the scope is exited.
But basically that is all that to-be-closed variables do - a promise
to run some code if the scope is exited. They do not promise to close
anything. They are not finalizers.
And because they are what they are, if a thread does not exit scope
they will never run.
Regards
Dibyendu