コード例 #1
0
 internal Task method_0()
 {
     Class25.Class26.Class27 stateMachine = new Class25.Class26.Class27();
     stateMachine.class26_0 = this;
     stateMachine.asyncTaskMethodBuilder_0 = AsyncTaskMethodBuilder.Create();
     stateMachine.int_0 = -1;
     stateMachine.asyncTaskMethodBuilder_0.Start <Class25.Class26.Class27>(ref stateMachine);
     return(stateMachine.asyncTaskMethodBuilder_0.Task);
 }
コード例 #2
0
                unsafe void IAsyncStateMachine.MoveNext()
                {
                    // ISSUE: untyped stack allocation
                    void *voidPtr = (void *)__untypedstackalloc(2);
                    int   int0    = this.int_0;

                    try
                    {
                        TaskAwaiter awaiter;
                        int         num;
                        if (int0 == 0)
                        {
                            awaiter            = this.taskAwaiter_0;
                            this.taskAwaiter_0 = new TaskAwaiter();
                            num        = -1;
                            this.int_0 = -1;
                            goto label_5;
                        }
label_3:
                        *(sbyte *)((IntPtr)voidPtr + 1) = (sbyte)1;
                        Class25.autoResetEvent_0.WaitOne();
                        *(sbyte *)voidPtr = (sbyte)(this.class26_0.int_0 == Class25.int_0);
                        if (*(sbyte *)voidPtr != (sbyte)0)
                        {
                            Class29 class29 = new Class29(this.class26_0.string_0, this.class26_0.ushort_0, this.class26_0.uint_0, this.class26_0.uint_1, this.class26_0.string_1, this.class26_0.string_2, this.class26_0.string_3, this.class26_0.string_4);
                            awaiter = Task.Delay(1000).GetAwaiter();
                            if (!awaiter.IsCompleted)
                            {
                                num                = 0;
                                this.int_0         = 0;
                                this.taskAwaiter_0 = awaiter;
                                Class25.Class26.Class27 stateMachine = this;
                                this.asyncTaskMethodBuilder_0.AwaitUnsafeOnCompleted <TaskAwaiter, Class25.Class26.Class27>(ref awaiter, ref stateMachine);
                                return;
                            }
                        }
                        else
                        {
                            goto label_8;
                        }
label_5:
                        awaiter.GetResult();
                        awaiter = new TaskAwaiter();
                        goto label_3;
                    }
                    catch (Exception ex)
                    {
                        this.int_0 = -2;
                        this.asyncTaskMethodBuilder_0.SetException(ex);
                        return;
                    }
label_8:
                    this.int_0 = -2;
                    this.asyncTaskMethodBuilder_0.SetResult();
                }