Revision 9d6d2f6e
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); |
... | ... | |
383 | 383 |
throw new ArgumentException("The CloudAction.AccountInfo is empty","cloudAction"); |
384 | 384 |
Contract.EndContractBlock(); |
385 | 385 |
|
386 |
_pauseAgent.Wait(); |
|
387 |
|
|
386 | 388 |
//If the action targets a local file, add a treehash calculation |
387 | 389 |
if (!(cloudAction is CloudDeleteAction) && cloudAction.LocalFile as FileInfo != null) |
388 | 390 |
{ |
... | ... | |
477 | 479 |
|
478 | 480 |
try |
479 | 481 |
{ |
480 |
|
|
482 |
_pauseAgent.Wait(); |
|
481 | 483 |
//Get the list of server objects changed since the last check |
482 | 484 |
//The name of the container is passed as state in order to create a dictionary of tasks in a subsequent step |
483 | 485 |
var listObjects = from container in containers |
Also available in: Unified diff