Lines Matching defs:thin

37  * The two states of an Object's lock are referred to as "thin" and
38 * "fat". A lock may transition from the "thin" state to the "fat"
43 * lock encodes its state. When cleared, the lock is in the "thin"
55 * For an in-depth description of the mechanics of thin-vs-fat locking,
167 * object may be unlocked, thin-locked, or fat-locked.
195 * thin again. This is called during garbage collection.
826 * Changes the shape of a monitor from thin to fat, preserving the
832 u4 thin;
842 thin = obj->lock;
843 mon->lockCount = LW_LOCK_COUNT(thin);
844 thin &= LW_HASH_STATE_MASK << LW_HASH_STATE_SHIFT;
845 thin |= (u4)mon | LW_SHAPE_FAT;
847 android_atomic_release_store(thin, (int32_t *)&obj->lock);
864 u4 thin, newThin, threadId;
871 thin = *thinp;
872 if (LW_SHAPE(thin) == LW_SHAPE_THIN) {
874 * The lock is a thin lock. The owner field is used to
877 if (LW_LOCK_OWNER(thin) == threadId) {
891 } else if (LW_LOCK_OWNER(thin) == 0) {
898 newThin = thin | (threadId << LW_LOCK_OWNER_SHIFT);
899 if (android_atomic_acquire_cas(thin, newThin,
908 threadId, &obj->lock, 0, *thinp, thin);
915 * Spin until the thin lock is released or inflated.
919 thin = *thinp;
924 if (LW_SHAPE(thin) == LW_SHAPE_THIN) {
925 if (LW_LOCK_OWNER(thin) == 0) {
931 newThin = thin | (threadId << LW_LOCK_OWNER_SHIFT);
932 if (android_atomic_acquire_cas(thin, newThin,
965 * The thin lock was inflated by another thread.
976 threadId, &obj->lock, 0, *thinp, thin);
978 * We have acquired the thin lock. Let the VM know that
1004 u4 thin;
1013 thin = *(volatile u4 *)&obj->lock;
1014 if (LW_SHAPE(thin) == LW_SHAPE_THIN) {
1016 * The lock is thin. We must ensure that the lock is owned
1019 if (LW_LOCK_OWNER(thin) == self->threadId) {
1024 if (LW_LOCK_COUNT(thin) == 0) {
1030 thin &= (LW_HASH_STATE_MASK << LW_HASH_STATE_SHIFT);
1031 android_atomic_release_store(thin, (int32_t*)&obj->lock);
1070 u4 thin = *(volatile u4 *)&obj->lock;
1072 /* If the lock is still thin, we need to fatten it.
1074 if (LW_SHAPE(thin) == LW_SHAPE_THIN) {
1077 if (LW_LOCK_OWNER(thin) != self->threadId) {
1100 u4 thin = *(volatile u4 *)&obj->lock;
1102 /* If the lock is still thin, there aren't any waiters;
1105 if (LW_SHAPE(thin) == LW_SHAPE_THIN) {
1108 if (LW_LOCK_OWNER(thin) != self->threadId) {
1119 notifyMonitor(self, LW_MONITOR(thin));
1128 u4 thin = *(volatile u4 *)&obj->lock;
1130 /* If the lock is still thin, there aren't any waiters;
1133 if (LW_SHAPE(thin) == LW_SHAPE_THIN) {
1136 if (LW_LOCK_OWNER(thin) != self->threadId) {
1147 notifyAllMonitor(self, LW_MONITOR(thin));
1207 * Note that fat vs. thin doesn't matter here; waitMonitor
1284 * If the lock is thin assume it is unowned. We simulate