Example usage for com.google.common.util.concurrent Monitor isOccupiedByCurrentThread

List of usage examples for com.google.common.util.concurrent Monitor isOccupiedByCurrentThread

Introduction

In this page you can find the example usage for com.google.common.util.concurrent Monitor isOccupiedByCurrentThread.

Prototype

public boolean isOccupiedByCurrentThread() 

Source Link

Document

Returns whether the current thread is occupying this monitor (has entered more times than it has left).

Usage

From source file:clocker.docker.location.strategy.basic.GroupPlacementStrategy.java

@Override
public void releaseMutex(String mutexId) {
    LOG.debug("Leaving monitor {}", mutexId);
    Monitor monitor = lookupMonitor(mutexId);
    if (monitor != null && monitor.isOccupiedByCurrentThread()) {
        monitor.leave();//from   ww w .ja v a  2s.  c o m
    }
}