예제 #1
0
            static CanceledETTaskCache()
            {
                ETTaskCompletionSource tcs = new ETTaskCompletionSource();

                tcs.TrySetCanceled();
                Task = tcs.Task;
            }
예제 #2
0
        public ETTask <CoroutineLock> Wait(CoroutineLockType coroutineLockType, long key)
        {
            CoroutineLockQueueType coroutineLockQueueType = this.list[(int)coroutineLockType];

            if (!coroutineLockQueueType.TryGetValue(key, out CoroutineLockQueue queue))
            {
                queue = EntityFactory.Create <CoroutineLockQueue>(this.Domain);
                coroutineLockQueueType.Add(key, queue);

                return(ETTask.FromResult(EntityFactory.CreateWithParent <CoroutineLock, CoroutineLockType, long>(this, coroutineLockType, key)));
            }

            ETTaskCompletionSource <CoroutineLock> tcs = new ETTaskCompletionSource <CoroutineLock>();

            queue.Enqueue(tcs);
            return(tcs.Task);
        }
예제 #3
0
 public Awaiter(ETTask task)
 {
     this.task = task;
 }