int count = 0;
    public final void lock() {        if (this.owner == VmMagic.currentProcessor()) {            // We already own this lock, increment the lock count.            lockCount = lockCount.add(Word.one());        } else {            final Address ownerAddr = ObjectReference.fromObject(this)                    .toAddress();            final ObjectReference procRef = ObjectReference.fromObject(VmMagic                    .currentProcessor());            int count = 0;            while (!ownerAddr.attempt(null, procRef)) {                // Busy wait                if (++count > 10000) {                    VmMagic.currentProcessor().getArchitecture().getStackReader().debugStackTrace();                    Unsafe.die("ProcessorLock.lock");                }            }            // Now I'm the owner            lockCount = lockCount.add(Word.one());        }    }