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

Commit 72386200 authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Make threadlocals volatile

As they may be accessed from multiple thrads

Bug: 292141694
Test: atest CtsOsTestCasesRavenwood
Change-Id: Ifb941a313bb8fccf3aba8a82f3e0e1d2f08851d9
parent a9d2c1f1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -292,7 +292,7 @@ public class Binder implements IBinder {
        sWarnOnBlockingOnCurrentThread.set(sWarnOnBlocking);
    }

    private static ThreadLocal<SomeArgs> sIdentity$ravenwood;
    private static volatile ThreadLocal<SomeArgs> sIdentity$ravenwood;

    @android.ravenwood.annotation.RavenwoodKeepWholeClass
    private static class IdentitySupplier implements Supplier<SomeArgs> {
+1 −1
Original line number Diff line number Diff line
@@ -844,7 +844,7 @@ public class Process {
        return "amd64".equals(System.getProperty("os.arch"));
    }

    private static ThreadLocal<SomeArgs> sIdentity$ravenwood;
    private static volatile ThreadLocal<SomeArgs> sIdentity$ravenwood;

    /** @hide */
    @android.ravenwood.annotation.RavenwoodKeep