When two different execution contexts that share a closure variable are entered in parallel, one will acquire a lock
means that a listener will lock on parent closure right at the start of the function till its end? Or it will lock only from the time of identifier resolution for count to finishing its value reading?
So, in this particular example
means that a listener will lock on parent closure right at the start of the function till its end? Or it will lock only from the time of identifier resolution for
count
to finishing its value reading?It will only lock upon access to the variable and then it will release the lock as soon as it is done.
Thank you.
You’re welcome :)