コード例 #1
0
        override public TaskControlBlock run(Packet packet)
        {
            Packet v1 = (Packet)this.v1;

            if (packet != null)
            {
                if (packet.kind == Kind.WORK)
                {
                    this.v1 = packet.addTo(v1);
                }
                else
                {
                    this.v2 = packet.addTo(this.v2);
                }
            }
            v1 = (Packet)this.v1;
            if (this.v1 != null)
            {
                int    count = v1.a1;
                Packet v;
                if (count < Richards.DATA_SIZE)
                {
                    if (this.v2 != null)
                    {
                        v       = this.v2;
                        this.v2 = this.v2.link;
                        v.a1    = v1.a2[count];
                        v1.a1   = count + 1;
                        this.v1 = v1;
                        return(this.scheduler.queue(v));
                    }
                }
                else
                {
                    v       = v1;
                    this.v1 = v1.link;
                    return(this.scheduler.queue(v));
                }
            }
            return(this.scheduler.suspendCurrent());
        }
コード例 #2
0
ファイル: Richards.cs プロジェクト: rainersigwald/coreclr
 TaskControlBlock run(Packet packet)
 {
     if (packet != null)
     {
         if (packet.kind == Support.KIND_WORK)
         {
             this.v1 = packet.addTo(this.v1);
         }
         else
         {
             this.v2 = packet.addTo(this.v2);
         }
     }
     if (this.v1 != null)
     {
         int    count = this.v1.a1;
         Packet v;
         if (count < Support.DATA_SIZE)
         {
             if (this.v2 != null)
             {
                 v          = this.v2;
                 this.v2    = this.v2.link;
                 v.a1       = this.v1.a2[count];
                 this.v1.a1 = count + 1;
                 return(this.scheduler.queue(v));
             }
         }
         else
         {
             v       = this.v1;
             this.v1 = this.v1.link;
             return(this.scheduler.queue(v));
         }
     }
     return(this.scheduler.suspendCurrent());
 }
コード例 #3
0
ファイル: Richards.cs プロジェクト: rainersigwald/coreclr
 /**
  * Adds a packet to the worklist of this block's task, marks this as runnable if
  * necessary, and returns the next runnable object to run (the one
  * with the highest priority).
  */
 public TaskControlBlock checkPriorityAdd(TaskControlBlock task, Packet packet)
 {
     if (this.queue == null)
     {
         this.queue = packet;
         this.markAsRunnable();
         if (this.priority >= task.priority)
         {
             return(this);
         }
     }
     else
     {
         this.queue = packet.addTo(this.queue);
     }
     return(task);
 }
コード例 #4
0
ファイル: Richards.cs プロジェクト: vkargov/coreclr
      TaskControlBlock run(Packet packet)
 {
     if (packet != null)
     {
         if (packet.kind == Support.KIND_WORK)
         {
             this.v1 = packet.addTo(this.v1);
         }
         else
         {
             this.v2 = packet.addTo(this.v2);
         }
     }
     if (this.v1 != null)
     {
         int count = this.v1.a1;
         Packet v;
         if (count < Support.DATA_SIZE)
         {
             if (this.v2 != null)
             {
                 v = this.v2;
                 this.v2 = this.v2.link;
                 v.a1 = this.v1.a2[count];
                 this.v1.a1 = count + 1;
                 return this.scheduler.queue(v);
             }
         }
         else
         {
             v = this.v1;
             this.v1 = this.v1.link;
             return this.scheduler.queue(v);
         }
     }
     return this.scheduler.suspendCurrent();
 }
コード例 #5
0
ファイル: Richards.cs プロジェクト: vkargov/coreclr
 /**
  * Adds a packet to the worklist of this block's task, marks this as runnable if
  * necessary, and returns the next runnable object to run (the one
  * with the highest priority).
  */
 public TaskControlBlock checkPriorityAdd(TaskControlBlock task, Packet packet)
 {
     if (this.queue == null)
     {
         this.queue = packet;
         this.markAsRunnable();
         if (this.priority >= task.priority) return this;
     }
     else
     {
         this.queue = packet.addTo(this.queue);
     }
     return task;
 }