src/concurrent/dotnet/ThreadPool.cs
/// <summary>
/// Wait for all threads to stop.
/// Return true on success or false on timeout.
/// </summary>
Wait for all threads to stop.
Return true on success or false on timeout.
Wait for all threads to stop . Return true on success or false on timeout .
[MethodImpl(MethodImplOptions.Synchronized)]
    public bool join(long msTimeout)
    {
      long deadline = Fan.Sys.Sys.nanoTime()/1000000L + msTimeout;
      while (true)
      {
        if (workers.Count == 0) return true;
        long toSleep = deadline - Fan.Sys.Sys.nanoTime()/1000000L;
        if (toSleep <= 0) return false;
        Monitor.Wait(this, (int)toSleep);
      }
    }
[ MethodImpl ( MethodImplOptions . Synchronized ) ] public bool join ( long msTimeout ) { long deadline = Fan . Sys . Sys . nanoTime ( ) / 1000000L + msTimeout ; while ( true ) { if ( workers . Count == 0 ) return true ; long toSleep = deadline - Fan . Sys . Sys . nanoTime ( ) / 1000000L ; if ( toSleep <= 0 ) return false ; Monitor . Wait ( this , ( int ) toSleep ) ; } }
Wait for all threads to stop.
Wait for all threads to stop .
// if all workers have completed, then return success // if we have gone past our deadline, return false // sleep until something interesting happens
msTimeout
long