Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.concurrent.locks.ReentrantLock;

public class Main {
    public static void requireLock(ReentrantLock lock) {
        if (!lock.isHeldByCurrentThread()) {
            throw new RuntimeException(
                    "Lock is not held by current thread: thread-name = " + Thread.currentThread().getName());
        }
    }
}