示例#1
0
        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);
        }
示例#2
0
 /// <summary>
 /// Thread acquires its epoch entry
 /// </summary>
 public void Acquire()
 {
     threadEntryIndex.InitializeThread();
     threadEntryIndex.Value = ReserveEntryForThread();
 }