src/concurrent/dotnet/Scheduler.cs
/// <summary>
/// Schedule the work item to be executed after
/// the given duration of nanoseconds has elapsed.
/// </summary>
Schedule the work item to be executed after
the given duration of nanoseconds has elapsed.
Schedule the work item to be executed after the given duration of nanoseconds has elapsed .
[MethodImpl(MethodImplOptions.Synchronized)]
    public void schedule(long ns, Work work)
    {
      bool newHead = add(ns, work);
      if (thread == null)
      {
        thread = new Thread(run);
        thread.Name = "Scheduler";
        thread.Start();
      }
      if (newHead) Monitor.PulseAll(this);
    }
[ MethodImpl ( MethodImplOptions . Synchronized ) ] public void schedule ( long ns , Work work ) { bool newHead = add ( ns , work ) ; if ( thread == null ) { thread = new Thread ( run ) ; thread . Name = " " ; thread . Start ( ) ; } if ( newHead ) Monitor . PulseAll ( this ) ; }
Schedule the work item to be executed after
the given duration of nanoseconds has elapsed.
Schedule the work item to be executed after the given duration of nanoseconds has elapsed .
// insert into our linked list // if we haven't launched our thread yet, then launch it // if we added to the head of our linked list, then we // modified our earliest deadline, so we need to notify thread
ns
long
work
Work