001 package railo.commons.lock; 002 003 import railo.runtime.exp.PageException; 004 005 006 public interface Lock { 007 008 public void lock(long timeout) throws PageException; 009 010 public void unlock(); 011 012 /** 013 * Returns an estimate of the number of threads waiting to 014 * acquire this lock. The value is only an estimate because the number of 015 * threads may change dynamically while this method traverses 016 * internal data structures. This method is designed for use in 017 * monitoring of the system state, not for synchronization 018 * control. 019 * 020 * @return the estimated number of threads waiting for this lock 021 */ 022 public int getQueueLength(); 023 }