Integrated: 8254780: EnterInterpOnlyModeClosure::completed() always returns true
Aleksey Shipilev
shade at openjdk.java.net
Wed Oct 14 21:01:17 UTC 2020
On Wed, 14 Oct 2020 15:16:54 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> JDK-8238761 introduced this funky code:
>
> class EnterInterpOnlyModeClosure : public HandshakeClosure {
> private:
> bool _completed;
> public:
> EnterInterpOnlyModeClosure() : HandshakeClosure("EnterInterpOnlyMode"), _completed(false) { }
> void do_thread(Thread* th) {
> ...
> _completed = true;
> }
> bool completed() {
> return _completed = true;
> }
> };
>
> It seems the flag is there to communicate that target thread indeed executed the handshake. But `completed()` sets the
> bool unconditionally and always returns true. And it is used in one and only place here:
> guarantee(hs.completed(), "Handshake failed: Target thread is not alive?");
>
> ...which means that guarantee always passes.
>
> Attention @robehn :)
This pull request has now been integrated.
Changeset: da2f5ab5
Author: Aleksey Shipilev <shade at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/da2f5ab5
Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
8254780: EnterInterpOnlyModeClosure::completed() always returns true
Reviewed-by: sspitsyn, rehn
-------------
PR: https://git.openjdk.java.net/jdk/pull/662
More information about the serviceability-dev
mailing list