예제 #1
0
 private void LandAfterWaiting(IStation station, Plane plane)
 {
     lock (station.Locker)
     {
         if (IsFirstWaiterPlane(station, plane))                                                 //check if its thread first time.
         {
             simulatorService.RemoveWaiterFromStations(plane, LandingRunways.Cast <IStation>()); //remove plane from station waiters list.
             LandingRunwayStation rws = station as LandingRunwayStation;
             Land(plane, rws);
             LandingWaiters.Remove(plane);
             Task.Run(() => ContinueMovement(plane, rws)); //Run it in another thread so other threads will execute.
         }
     }
 }