ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/tomcat/util/threads/TaskThread.java

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

      
    
Rootfs path

      
    
Size
2625 (2.6 KB)
MD5
f89f3a9b65af6a2e06a30b75d90e4a68
SHA1
e953c42b556f169aa5a0e8d55686bbd5b83ee364
SHA256
e92f2acdbe2838aa786b9ba8d8d93925163df07d250ee49a6570cd858d48980b
SHA512

      
    
SHA1_git
9ee60ce5e21eff0fe6f69dbb6919e1f07ff1f2a4
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
TaskThread.java | 2.6 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 * * http://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.util.threads; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; import org.apache.tomcat.util.res.StringManager; /** * A Thread implementation that records the time at which it was created. */ public class TaskThread extends Thread { private static final Log log = LogFactory.getLog(TaskThread.class); private static final StringManager sm = StringManager.getManager(TaskThread.class); private final long creationTime; public TaskThread(ThreadGroup group, Runnable target, String name) { super(group, new WrappingRunnable(target), name); this.creationTime = System.currentTimeMillis(); } public TaskThread(ThreadGroup group, Runnable target, String name, long stackSize) { super(group, new WrappingRunnable(target), name, stackSize); this.creationTime = System.currentTimeMillis(); } /** * @return the time (in ms) at which this thread was created */ public final long getCreationTime() { return creationTime; } /** * Wraps a {@link Runnable} to swallow any {@link StopPooledThreadException} instead of letting it go and * potentially trigger a break in a debugger. */ private record WrappingRunnable(Runnable wrappedRunnable) implements Runnable { @Override public void run() { try { wrappedRunnable.run(); } catch (StopPooledThreadException exc) { // expected : we just swallow the exception to avoid disturbing debuggers like eclipse's if (log.isDebugEnabled()) { log.debug(sm.getString("taskThread.exiting"), exc); } } } } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
40.48
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-4bde3f57-78aa-4201-96bf-531cba09e7de apache-2.0 Apache-2.0
URL Start line End line
http://www.apache.org/licenses/LICENSE-2.0 9 9