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

Commit 88d36827 authored by Felipe Leme's avatar Felipe Leme
Browse files

Introducing NamedLock.

This class should be used as a synchronization lock, so stack traces
show exactly what the lock's for (other than just it's internal address).

For example, instead of:

private final Object mRestrictionsLock = new Object();
private final Object mAppRestrictionsLock = new Object();

UserManagerService could use:

private final Object mRestrictionsLock = NamedLock.create("mRestrictionsLock");
private final Object mAppRestrictionsLock = NamedLock.create("mAppRestrictionsLock");

Test: atest FrameworksCoreTests --test-filter '.*NamedLockTest'
Bug: 436854624
Flag: EXEMPT new utility class

Change-Id: I6330bc9d697939f2486ab659f1317714adb20e42
parent 8fc01b34
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment