private Guid InternalAcquire() { epoch.Resume(); threadCtx.InitializeThread(); Phase phase = _systemState.phase; if (phase != Phase.REST) { throw new FasterException("Can acquire only in REST phase!"); } Guid guid = Guid.NewGuid(); threadCtx.Value = new FasterExecutionContext(); InitContext(threadCtx.Value, guid.ToString()); threadCtx.Value.prevCtx = new FasterExecutionContext(); InitContext(threadCtx.Value.prevCtx, guid.ToString()); threadCtx.Value.prevCtx.version--; InternalRefresh(threadCtx.Value); return(guid); }
/// <summary> /// Thread acquires its epoch entry /// </summary> public void Acquire() { threadEntryIndex.InitializeThread(); threadEntryIndex.Value = ReserveEntryForThread(); }