// Path: jdklib/src/main/java/com/current/lock/Lock.java
// public interface Lock {
// 
//     void lock() throws InterruptedException;
//     void unlock();
// }


import com.current.lock.Lock;
import java.util.logging.Level;
import java.util.logging.Logger;
package com.current.lock.v1;



/**
 * Author Mr.Pro
 * Date   9/6/17 = 8:32 PM
 */
public class SynchronizedLock implements Lock {

    private Logger logger = Logger.getLogger(SynchronizedLock.class.getName());

    private Byte[] obj;
    private volatile boolean hasLock;

    public SynchronizedLock(){
        obj = new Byte[0];
        hasLock = false;
    }

    @Override
    public void lock() throws InterruptedException {
        synchronized (obj){
            while (hasLock){
// Path: jdklib/src/main/java/com/current/lock/Lock.java
// public interface Lock {
// 
//     void lock() throws InterruptedException;
//     void unlock();
// }


// Path: jdklib/src/main/java/com/current/lock/v1/SynchronizedLock.java
import com.current.lock.Lock;
import java.util.logging.Level;
import java.util.logging.Logger;

package com.current.lock.v1;



/**
 * Author Mr.Pro
 * Date   9/6/17 = 8:32 PM
 */
public class SynchronizedLock implements Lock {

    private Logger logger = Logger.getLogger(SynchronizedLock.class.getName());

    private Byte[] obj;
    private volatile boolean hasLock;

    public SynchronizedLock(){
        obj = new Byte[0];
        hasLock = false;
    }

    @Override
    public void lock() throws InterruptedException {
        synchronized (obj){
            while (hasLock){
                try{