Java ReentrantLock lock()

Here you can find the source of lock()

Description

lock

License

Open Source License

Declaration

static boolean lock() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class Main {
    private static final Lock lock = new ReentrantLock();
    private static boolean locked = false;

    static boolean lock() {
        lock.lock();/*from  www. ja  v a2s.com*/
        locked = true;
        return locked;
    }
}

Related

  1. getActivityLock()
  2. getAudioLock()
  3. getLock(String id)
  4. getLockInfo(ReentrantLock lock)
  5. isRepair()
  6. readSyncLock(String id)
  7. removeJavaStdLoggerHandlers()
  8. runConcurrent(long startGapTime, Runnable... tasks)
  9. runUnderLock(ReentrantLock lock, Runnable runnable)