org.apache.hadoop.hbase.util
Class HasThread
java.lang.Object
org.apache.hadoop.hbase.util.HasThread
- All Implemented Interfaces:
- java.lang.Runnable
- Direct Known Subclasses:
- Chore, HMaster, Leases
public abstract class HasThread
- extends java.lang.Object
- implements java.lang.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(java.lang.String name)
getThread
public java.lang.Thread getThread()
run
public abstract void run()
- Specified by:
run
in interface java.lang.Runnable
getName
public final java.lang.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(java.lang.String name)
setPriority
public final void setPriority(int newPriority)
setUncaughtExceptionHandler
public void setUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler eh)
start
public void start()
join
public final void join()
throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
join
public final void join(long millis,
int nanos)
throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
join
public final void join(long millis)
throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
Copyright © 2013 The Apache Software Foundation. All Rights Reserved.