org.apache.hadoop.hbase.util
Class HasThread

java.lang.Object
  extended by 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.


Constructor Summary
HasThread()
           
HasThread(String name)
           
 
Method Summary
 String getName()
           
 Thread getThread()
           
 void interrupt()
           
 boolean isAlive()
           
 boolean isInterrupted()
           
 void join()
           
 void join(long millis)
           
 void join(long millis, int nanos)
           
abstract  void run()
           
 void setDaemon(boolean on)
           
 void setName(String name)
           
 void setPriority(int newPriority)
           
 void setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler eh)
           
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HasThread

public HasThread()

HasThread

public HasThread(String name)
Method Detail

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.