Exemple #1
0
 public bool Add(STMObject stmObject, ICloneable snapshot)
 {
     // overflow?
     if (next == size)
     {
         Pair[] newItems = new Pair[2 * size];
         items.CopyTo(newItems, 0);
         items = newItems;
         size  = 2 * size;
     }
     items[next++] = new Pair(stmObject, snapshot);
     return(true);
 }
Exemple #2
0
 public Pair(STMObject stmObject, ICloneable snapshot)
 {
     this.stmObject = stmObject;
     this.snapshot  = snapshot;
 }
Exemple #3
0
 public TList(int v)
 {
     readCache  = Thread.AllocateDataSlot();
     writeCache = Thread.AllocateDataSlot();
     stmObject  = new STMObject(new Foo(v), readCache, writeCache);
 }