Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

ThreadData.java

00001 package gov.nasa.arc.ase.jpf.jvm;
00002 
00003 import gov.nasa.arc.ase.util.HashData;
00004 //#ifdef RACE
00005 
00006 //#endif RACE
00007 
00008 class ThreadData {
00009   /**
00010    * Current state of the thread.
00011    */
00012   public int status;
00013 
00014   /**
00015    * Class associated with the thread.
00016    */
00017   public ClassInfo ci;
00018 
00019   /**
00020    * The object reference that is the thread.
00021    */
00022   public int objref;
00023 
00024   /**
00025    * The object reference of the target object if any.
00026    */
00027   public int target;
00028 
00029   /**
00030    * The lock counter when the object got into a wait.
00031    */
00032   public int lockCount;
00033 
00034   public Object clone() {
00035     ThreadData t = new ThreadData();
00036 
00037     t.status = status;
00038     t.ci = ci;
00039     t.objref = objref;
00040     t.target = target;
00041     t.lockCount = lockCount;
00042 //#ifdef RACE
00043 
00044 //#endif RACE
00045     return t;
00046   }  
00047   public boolean equals(Object o) {
00048     if(o == null) return false;
00049     if(!(o instanceof ThreadData)) return false;
00050 
00051     ThreadData t = (ThreadData)o;
00052     if(status != t.status) return false;
00053     if(ci != t.ci) return false;
00054     if(objref != t.objref) return false;
00055     if(target != t.target) return false;
00056     if(lockCount != t.lockCount) return false;
00057 //#ifdef RACE
00058 
00059 //#endif RACE
00060 //#ifdef LOCK_ORDER
00061 
00062 
00063 //#endif LOCK_ORDER
00064 
00065     return true;
00066   }  
00067   public void hash(HashData hd) {
00068     hd.add(status);
00069     hd.add(objref);
00070     hd.add(target);
00071     hd.add(lockCount);
00072   }  
00073 //#ifdef RACE
00074 
00075 
00076 
00077 
00078 
00079 
00080 
00081 //#endif RACE
00082 
00083 //#ifdef LOCK_ORDER
00084 
00085 
00086 
00087 
00088 
00089 
00090 
00091 
00092 
00093 
00094 
00095 
00096 
00097 
00098 //#endif LOCK_ORDER
00099 
00100   public int hashCode() {
00101     HashData hd = new HashData();
00102     
00103     hash(hd);
00104 
00105     return hd.getValue();
00106   }  
00107   public String toString() {
00108     StringBuffer sb = new StringBuffer();
00109 
00110     sb.append("ThreadData(");
00111     sb.append("status=");
00112     sb.append(status);
00113     sb.append(',');
00114     sb.append("ci=");
00115     if(ci == null)
00116       sb.append("null");
00117     else
00118       sb.append(ci.getName());
00119     sb.append(',');
00120     sb.append("objref=");
00121     sb.append(objref);
00122     sb.append(',');
00123     sb.append("target=");
00124     sb.append(target);
00125     sb.append(',');
00126     sb.append("lockCount=");
00127     sb.append(lockCount);
00128     sb.append(',');
00129 //#ifdef RACE
00130 
00131 
00132 
00133 //#endif RACE
00134 //#ifdef LOCK_ORDER
00135 
00136 
00137 
00138 
00139 
00140 
00141 //#endif LOCK_ORDER
00142     sb.append(')');
00143 
00144     return sb.toString();
00145   }  
00146 }

Generated at Thu Feb 7 06:57:02 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001