ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/tomcat/dbcp/pool2/impl/InterruptibleReentrantLock.java

Path
ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/tomcat/dbcp/pool2/impl/InterruptibleReentrantLock.java
Status
scanned
Type
file
Name
InterruptibleReentrantLock.java
Extension
.java
Programming language
Java
Mime type
text/plain
File type
ASCII text, with CRLF line terminators
Tag

      
    
Rootfs path

      
    
Size
2005 (2.0 KB)
MD5
20d66c9fa74a56e4905cac8a3f4d1b20
SHA1
25f6549edf6d99040ff41ede4dd329c113ed74f2
SHA256
cfd9559d0e4b28b5572e6ea92ce2d706ecd7c61cfe72d6844dfcbb8c119252a4
SHA512

      
    
SHA1_git
e51ee794609f7cf6a99004fdbd501410cff07a6a
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
InterruptibleReentrantLock.java | 2.0 KB |

/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.tomcat.dbcp.pool2.impl; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.ReentrantLock; /** * This sub-class was created to expose the waiting threads so that they can be * interrupted when the pool using the queue that uses this lock is closed. The * class is intended for internal use only. * <p> * This class is intended to be thread-safe. * </p> * * @since 2.0 */ final class InterruptibleReentrantLock extends ReentrantLock { private static final long serialVersionUID = 1L; /** * Constructs a new InterruptibleReentrantLock with the given fairness policy. * * @param fairness true means threads should acquire contended locks as if * waiting in a FIFO queue. */ InterruptibleReentrantLock(final boolean fairness) { super(fairness); } /** * Interrupts the threads that are waiting on a specific condition. * * @param condition the condition on which the threads are waiting. */ void interruptWaiters(final Condition condition) { getWaitingThreads(condition).forEach(Thread::interrupt); } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
47.6
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-eb6b5ae0-4f88-4e9b-d67c-c6c8e733b1cd apache-2.0 Apache-2.0
URL Start line End line
https://www.apache.org/licenses/LICENSE-2.0 9 9