public LayerWriteGroup(LayerManager _layer, WriteGroupType type = DEFAULT_WG_TYPE)
{
this.mylayer = _layer;
this.tsn = _layer.tsnidgen.nextTimestamp();
this.type = type;
mylayer.pending_txns.Add(tsn, new WeakReference<LayerWriteGroup>(this)); // track pending transactions without preventing collection
// TODO: store the stack backtrace of who created this if we're in debug mode
}