Implicit scope handle
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Mon Apr 26 20:10:45 UTC 2021
That is all documented in the javadoc - e.g. acquiring an implicit scope
is essentially a no-op. The only thing we guarantee is that if you use
this idiom:
```
var handle = scope.acquire();
try {
// critical region
} finally {
scope.release(handle);
}
```
the scope will not be closed inside the critical region (because of the
reachability fence inside the `release` method).
Maurizio
On 26/04/2021 19:44, Radosław Smogura wrote:
> Hi,
>
> I think this is last thing I noticed.
>
> The implicit scope’s handle may not work correctly and prevent garbage collection from happening.
>
> Right now the shared handle is returns what it’s ok for global scope.
>
> For separately create implicit scope, I think new handle should be created, having reference to the scope which can be cleared on close.
>
> Best regards,
> Radoq
More information about the panama-dev
mailing list