Revision 303596f9 trunk/Pithos.Core/Agents/NetworkAgent.cs

b/trunk/Pithos.Core/Agents/NetworkAgent.cs
65 65
        readonly ConcurrentDictionary<string,DateTime> _deletedFiles=new ConcurrentDictionary<string, DateTime>();
66 66

  
67 67

  
68
        private readonly ManualResetEventSlim _pauseAgent = new ManualResetEventSlim(true);
69 68

  
70 69
        [System.ComponentModel.Composition.Import]
71 70
        public IStatusKeeper StatusKeeper { get; set; }
......
80 79
        public IPithosSettings Settings { get; set; }
81 80

  
82 81
        private bool _firstPoll = true;
82
        
83 83
        private TaskCompletionSource<bool> _tcs;
84
        private ConcurrentDictionary<string,DateTime> _lastSeen=new ConcurrentDictionary<string, DateTime>();
84
        private readonly AsyncManualResetEvent _pauseAgent = new AsyncManualResetEvent(true);
85

  
86
        private ConcurrentDictionary<string, DateTime> _lastSeen = new ConcurrentDictionary<string, DateTime>();
85 87

  
86 88
        public void Start()
87 89
        {
......
522 524

  
523 525
            using (log4net.ThreadContext.Stacks["Retrieve Remote"].Push(accountInfo.UserName))
524 526
            {
525
                _pauseAgent.Wait();
527
                await _pauseAgent.WaitAsync();
526 528

  
527 529
                Log.Info("Scheduled");
528 530
                var client = new CloudFilesClient(accountInfo)
......
537 539

  
538 540
                try
539 541
                {
540
                    _pauseAgent.Wait();
542
                    await _pauseAgent.WaitAsync();
541 543
                    //Get the poll time now. We may miss some deletions but it's better to keep a file that was deleted
542 544
                    //than delete a file that was created while we were executing the poll                    
543 545
                    var pollTime = DateTime.Now;

Also available in: Unified diff