示例#1
0
        //
        // Cancels the specified add attempt.
        //

        internal override void CancelAddAttempt(WaitNode wn, WaitNode ignored)
        {
            if (wn.next != wn)
            {
                qlock.Enter();
                waitQueue.Remove(wn);
                qlock.Exit();
            }
        }
示例#2
0
 /// <summary>
 /// Unblock, but do not resume, the specified <see cref="DesTask"/>.
 /// </summary>
 /// <remarks>
 /// <para>
 /// This method is used to remove <paramref name="desTask"/> from the
 /// <see cref="DesTask"/> instance's wait list without resuming the
 /// execution of <paramref name="desTask"/>.  The most common use for
 /// invoking <see cref="Unblock"/> is to stop a <see cref="DesTask"/>
 /// from waiting after it has been resumed by another means (e.g. a
 /// different simulation object has resumed <paramref name="desTask"/>).
 /// </para>
 /// <para>
 /// Again, it's very important to realize that <see cref="Unblock"/>
 /// does <b>not</b> activate <paramref name="desTask"/>.
 /// </para>
 /// <para>
 /// This method does nothing if <paramref name="desTask"/> equals
 /// <c>this</c> or is <see langword="null"/>.
 /// </para>
 /// </remarks>
 /// <param name="desTask">
 /// The <see cref="DesTask"/> which will stop blocking on this
 /// <see cref="DesTask"/> instance.
 /// </param>
 public virtual void Unblock(DesTask desTask)
 {
     if (desTask != null && desTask != this && BlockCount > 0)
     {
         WaitQueue.Remove(desTask);
         desTask.UpdateBlockingLinks(this, false);
     }
 }
示例#3
0
文件: Task.cs 项目: anh123minh/DES
 /// <summary>
 /// Unblock, but do not resume, the specified <see cref="Task"/>.
 /// </summary>
 /// <remarks>
 /// <para>
 /// This method is used to remove <paramref name="task"/> from the
 /// <see cref="Task"/> instance's wait list without resuming the
 /// execution of <paramref name="task"/>.  The most common use for
 /// invoking <see cref="Unblock"/> is to stop a <see cref="Task"/>
 /// from waiting after it has been resumed by another means (e.g. a
 /// different simulation object has resumed <paramref name="task"/>).
 /// </para>
 /// <para>
 /// Again, it's very important to realize that <see cref="Unblock"/>
 /// does <b>not</b> activate <paramref name="task"/>.
 /// </para>
 /// <para>
 /// This method does nothing if <paramref name="task"/> equals
 /// <c>this</c> or is <see langword="null"/>.
 /// </para>
 /// </remarks>
 /// <param name="task">
 /// The <see cref="Task"/> which will stop blocking on this
 /// <see cref="Task"/> instance.
 /// </param>
 public virtual void Unblock(Task task)
 {
     if (task != null && task != this && BlockCount > 0)
     {
         WaitQueue.Remove(task);
         task.UpdateBlockingLinks(this, false);
     }
 }