diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2024-03-02 11:52:31 +0100 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2024-03-12 08:21:38 +0100 |
commit | 43df701a10a80306dd98da8644a9bbfbf5d17089 (patch) | |
tree | 8feb6335937a3a5d1e6170a7325c14dd4b4226b7 /bridge | |
parent | 966397e3bfe0d38aeca28c6aec0f543d62a0e2ea (diff) | |
download | aspectj-43df701a10a80306dd98da8644a9bbfbf5d17089.tar.gz aspectj-43df701a10a80306dd98da8644a9bbfbf5d17089.zip |
Avoid ThreadLocal memory leak in JoinPointImpl
according to https://rules.sonarsource.com/java/tag/leak/RSPEC-5164/.
Now, there no longer is a thread-local stack of AroundClosure instances,
but rather a list of them, which can only grow but never shrink.
Instead, we now have a thread-local (integer) list index, for every
thread being initialised with pointing to the last element. I.e., every
thread can unwind by decrementing the index while proceeding,
independently of other threads.
A positive side effect is that this approach also works for long-lived
threads from thread pools, used by executor services. Hence, test
Bugs199Tests.testAsyncProceedNestedAroundAdviceThreadPool_gh128, which
was previously commented out, has been activated and passes, see #141.
I am not sure if this brings @AspectJ style, non-inlined, nested around
advice execution functionally on par with native ones, but at least for
current scenarios it seems to work.
Fixes #288, #141.
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'bridge')
0 files changed, 0 insertions, 0 deletions