Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c59a6623 authored by Jesse Wilson's avatar Jesse Wilson
Browse files

Fix double-checked locking bug in LocalSocket.

This code uses a try/finally to maintain the old behavior of setting
implCreated even if creation fails.

Change-Id: Ieac05568477db4908cd4087714cf00a9addd1d20
parent b08013c3
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -70,8 +70,11 @@ public class LocalSocket {
        if (!implCreated) {
            synchronized (this) {
                if (!implCreated) {
                    implCreated = true;
                    try {
                        impl.create(true);
                    } finally {
                        implCreated = true;
                    }
                }
            }
        }