Ejemplo n.º 1
0
 public bool AwaitTermination(long n, Sharpen.TimeUnit unit)
 {
     WaitHandle[] handles;
     lock (tasks) {
         if (tasks.Count == 0)
         {
             return(true);
         }
         handles = tasks.ToArray();
     }
     return(WaitHandle.WaitAll(handles, (int)unit.Convert(n, TimeUnit.MILLISECONDS)));
 }
Ejemplo n.º 2
0
 public bool Await(long timeout, Sharpen.TimeUnit unit)
 {
     return(done.WaitOne((int)unit.Convert(timeout, TimeUnit.MILLISECONDS)));
 }