// Path: src/main/java/com/google/code/tempusfugit/concurrency/Callable.java
// public interface Callable<V, E extends Exception> extends java.util.concurrent.Callable<V> {
//     V call() throws E;
// }
// 
// Path: src/main/java/com/google/code/tempusfugit/concurrency/Interruptible.java
// public interface Interruptible<T> extends Callable<T> {
//     T call() throws InterruptedException;
// }
// 
// Path: src/main/java/com/google/code/tempusfugit/concurrency/ThreadUtils.java
// public static <T> T resetInterruptFlagWhen(Interruptible<T> interruptible) {
//     try {
//         return interruptible.call();
//     } catch (InterruptedException e) {
//         Thread.currentThread().interrupt();
//     }
//     return null;
// }


import com.google.code.tempusfugit.concurrency.Callable;
import com.google.code.tempusfugit.concurrency.Interruptible;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import static com.google.code.tempusfugit.concurrency.ThreadUtils.resetInterruptFlagWhen;
/*
 * Copyright (c) 2009-2018, toby weston & tempus-fugit committers
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at 
 *
 *      http://www.apache.org/licenses/LICENSE-2.0 
 *
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS, 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 * See the License for the specific language governing permissions and 
 * limitations under the License.
 */

package com.google.code.tempusfugit.concurrency.kidnapping;




public class InterruptibleLock implements Cash, Cat {

    private final Lock lock = new ReentrantLock();
// Path: src/main/java/com/google/code/tempusfugit/concurrency/Callable.java
// public interface Callable<V, E extends Exception> extends java.util.concurrent.Callable<V> {
//     V call() throws E;
// }
// 
// Path: src/main/java/com/google/code/tempusfugit/concurrency/Interruptible.java
// public interface Interruptible<T> extends Callable<T> {
//     T call() throws InterruptedException;
// }
// 
// Path: src/main/java/com/google/code/tempusfugit/concurrency/ThreadUtils.java
// public static <T> T resetInterruptFlagWhen(Interruptible<T> interruptible) {
//     try {
//         return interruptible.call();
//     } catch (InterruptedException e) {
//         Thread.currentThread().interrupt();
//     }
//     return null;
// }


// Path: src/test/java/com/google/code/tempusfugit/concurrency/kidnapping/InterruptibleLock.java
import com.google.code.tempusfugit.concurrency.Callable;
import com.google.code.tempusfugit.concurrency.Interruptible;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import static com.google.code.tempusfugit.concurrency.ThreadUtils.resetInterruptFlagWhen;

/*
 * Copyright (c) 2009-2018, toby weston & tempus-fugit committers
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at 
 *
 *      http://www.apache.org/licenses/LICENSE-2.0 
 *
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS, 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 * See the License for the specific language governing permissions and 
 * limitations under the License.
 */

package com.google.code.tempusfugit.concurrency.kidnapping;




public class InterruptibleLock implements Cash, Cat {

    private final Lock lock = new ReentrantLock();
    private final CountDownLatch latch;