예제 #1
0
        public override async Task End(object obj, SynchronousOptions opts = null)
        {
            var willLeftBegin  = LeftSynchronizer.WillBegin(obj);
            var willRightBegin = RightSynchronizer.WillBegin(obj);

            if (willLeftBegin && willRightBegin)
            {
                await Task.CompletedTask;
            }
            else if (willLeftBegin)
            {
                await RightSynchronizer.End(obj, SynchronousOptions.UpdateInternalOptions(opts, new InternalSynchronousOptions().WithHandlingCondition()));
            }
            else if (willRightBegin)
            {
                await LeftSynchronizer.End(obj, SynchronousOptions.UpdateInternalOptions(opts, new InternalSynchronousOptions().WithHandlingCondition()));
            }
            else
            {
                await LeftSynchronizer.End(obj, opts);
            }
        }
예제 #2
0
 public override Task End(object obj, SynchronousOptions opts = null)
 {
     return(Task.WhenAll(LeftSynchronizer.End(obj, opts), RightSynchronizer.End(obj, opts)));
 }