edu.rice.cs.cunit.instrumentors
Class AssignThreadIDStrategy

java.lang.Object
  extended by edu.rice.cs.cunit.instrumentors.AssignThreadIDStrategy
All Implemented Interfaces:
IInstrumentationStrategy

public class AssignThreadIDStrategy
extends java.lang.Object
implements IInstrumentationStrategy

Instrumentation strategy that adds code to java.lang.Thread to maintain a unique thread ID and an "old thread" flag. NOTE: This instrumentor has to be run AFTER the CompactSynchronizedDebugStrategy, otherwise the MONITORENTER and MONITOREXIT instructions will generate multiple sync points.

Author:
Mathias Ricken

Constructor Summary
AssignThreadIDStrategy()
           
 
Method Summary
 void done()
          Instrumentation of all classes is done.
 void instrument(ClassFile cf)
          Instrument the class.
protected  void processCtor(ClassFile cf, MethodInfo mi, int threadID, int nextThreadID, int oldThread)
          Process this constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssignThreadIDStrategy

public AssignThreadIDStrategy()
Method Detail

instrument

public void instrument(ClassFile cf)
Instrument the class.

Specified by:
instrument in interface IInstrumentationStrategy
Parameters:
cf - class file info

processCtor

protected void processCtor(ClassFile cf,
                           MethodInfo mi,
                           int threadID,
                           int nextThreadID,
                           int oldThread)
Process this constructor.

Parameters:
cf - class file info
mi - method info
threadID - index of the threadID field
nextThreadID - index of the nextThreadID field
oldThread - index of the oldThread field

done

public void done()
Instrumentation of all classes is done.

Specified by:
done in interface IInstrumentationStrategy