jp.co.scs.mbench
クラス Synchronizer

java.lang.Object
  上位を拡張 java.lang.Thread
      上位を拡張 jp.co.scs.mbench.Synchronizer
すべての実装されたインタフェース:
java.lang.Runnable

public class Synchronizer
extends java.lang.Thread

Synchronizer

作成者:
Tetsuro Ikeda

入れ子のクラスの概要
 
クラス java.lang.Thread から継承された入れ子のクラス/インタフェース
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
フィールドの概要
 
クラス java.lang.Thread から継承されたフィールド
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
コンストラクタの概要
Synchronizer()
           
 
メソッドの概要
 void doSynchronize()
          Synchronizes.
 long getTimeout()
          Gets the timeout.
 void run()
          just invoke the "doSynchronize"
 void setTimeout(long timeout)
          Sets the timeout.
 
クラス java.lang.Thread から継承されたメソッド
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

Synchronizer

public Synchronizer()
メソッドの詳細

setTimeout

public void setTimeout(long timeout)
Sets the timeout.

パラメータ:
timeout - timeout

getTimeout

public long getTimeout()
Gets the timeout.

戻り値:
timeout (messure : ms)

doSynchronize

public void doSynchronize()
Synchronizes. The 1st caller get the lock of this object. The 2nd caller and later wait until the first caller release the lock. The 1st caller thread also become "wait mode" by using Thread#sleep method. So, it means you must not call this method directory (if you behave as first caller), and you must call Synchronizer#start method instead of this method. Synchronizer#start method creates a new thread and the thread only calls this method. You can do something todo, then call Synchronizer#interrupt method. It cause release of the lock, and let another caller (2nd one and later) go through the lock. These are designed to synchronize all benchmark container. By the default setting, the timeout is occured in 60sec.


run

public void run()
just invoke the "doSynchronize"

定義:
インタフェース java.lang.Runnable 内の run
オーバーライド:
クラス java.lang.Thread 内の run