reentrantlock.java

来自「java开源的企业总线.xmlBlaster」· Java 代码 · 共 33 行

JAVA
33
字号
/*------------------------------------------------------------------------------Name:      ReentrantLock.javaProject:   xmlBlaster.orgCopyright: xmlBlaster.org, see xmlBlaster-LICENSE fileComment:   Create unique timestamp------------------------------------------------------------------------------*/package org.xmlBlaster.util;/** * Extends a reentrantLock of Doug Lea and adds a lock() method similar * to the new java.util.concurrent.locks.ReentrantLock of JDK 1.5.  * @author <a href="mailto:xmlBlaster@marcelruff.info">Marcel Ruff</a> * @see org.xmlBlaster.test.classtest.ReentrantLockTest */public final class ReentrantLock extends EDU.oswego.cs.dl.util.concurrent.ReentrantLock{   /**    * Acquires the lock, same as acquire(), but ignoring a InterruptedException.     */   public void lock() {      while (true) {         try {            super.acquire();            return;         }         catch (InterruptedException e) {         }      }   }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?