Revision c99473ae
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 AutoResetEvent _pauseAgent = new AutoResetEvent(false);
|
|
68 |
private readonly ManualResetEventSlim _pauseAgent = new ManualResetEventSlim(true);
|
|
69 | 69 |
|
70 | 70 |
[System.ComponentModel.Composition.Import] |
71 | 71 |
public IStatusKeeper StatusKeeper { get; set; } |
... | ... | |
84 | 84 |
Action loop = null; |
85 | 85 |
loop = () => |
86 | 86 |
{ |
87 |
_pauseAgent.WaitOne();
|
|
87 |
_pauseAgent.Wait(); |
|
88 | 88 |
var message = inbox.Receive(); |
89 | 89 |
var process=message.Then(Process,inbox.CancellationToken); |
90 | 90 |
inbox.LoopAsync(process, loop); |
... | ... | |
277 | 277 |
} |
278 | 278 |
finally |
279 | 279 |
{ |
280 |
//Set the event when all delete actions are processed |
|
280 | 281 |
if (_deleteAgent.InputCount == 0) |
281 | 282 |
_pauseAgent.Set(); |
282 | 283 |
|
... | ... | |
468 | 469 |
|
469 | 470 |
using (log4net.ThreadContext.Stacks["Retrieve Remote"].Push(accountInfo.UserName)) |
470 | 471 |
{ |
472 |
_pauseAgent.Wait(); |
|
473 |
|
|
471 | 474 |
Log.Info("Scheduled"); |
472 | 475 |
var client=new CloudFilesClient(accountInfo); |
473 | 476 |
|
474 | 477 |
var containers = client.ListContainers(accountInfo.UserName); |
475 |
|
|
478 |
|
|
479 |
|
|
476 | 480 |
CreateContainerFolders(accountInfo, containers); |
477 | 481 |
|
478 | 482 |
try |
Also available in: Unified diff