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
Loading
Please register or sign in to comment