org.apache.hadoop.hbase.util
Class HasThread
java.lang.Object
org.apache.hadoop.hbase.util.HasThread
- All Implemented Interfaces:
- Runnable
- Direct Known Subclasses:
- Chore
@InterfaceAudience.Private
public abstract class HasThread
- extends Object
- implements Runnable
Abstract class which contains a Thread and delegates the common Thread
methods to that instance.
The purpose of this class is to workaround Sun JVM bug #6915621, in which
something internal to the JDK uses Thread.currentThread() as a monitor
lock. This can produce deadlocks like HBASE-4367, HBASE-4101, etc.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HasThread
public HasThread()
HasThread
public HasThread(String name)
getThread
public Thread getThread()
run
public abstract void run()
- Specified by:
run
in interface Runnable
getName
public final String getName()
interrupt
public void interrupt()
isAlive
public final boolean isAlive()
isInterrupted
public boolean isInterrupted()
setDaemon
public final void setDaemon(boolean on)
setName
public final void setName(String name)
setPriority
public final void setPriority(int newPriority)
setUncaughtExceptionHandler
public void setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler eh)
start
public void start()
join
public final void join()
throws InterruptedException
- Throws:
InterruptedException
join
public final void join(long millis,
int nanos)
throws InterruptedException
- Throws:
InterruptedException
join
public final void join(long millis)
throws InterruptedException
- Throws:
InterruptedException
Copyright © 2013 The Apache Software Foundation. All Rights Reserved.