_tcs.Task.Wait();\r
}\r
\r
- public void Set() { _tcs.TrySetResult(true); }\r
+ public void Set()\r
+ {\r
+ var tcs = _tcs;\r
+ Task.Factory.StartNew(s => ((TaskCompletionSource<bool>)s).TrySetResult(true),\r
+ tcs, CancellationToken.None, TaskCreationOptions.PreferFairness, TaskScheduler.Default);\r
+ tcs.Task.Wait(); \r
+ }\r
\r
public void Reset()\r
{\r
//Remote files are polled periodically. Any changes are processed
public async Task PollRemoteFiles(DateTime? since = null)
{
+ Debug.Assert(Thread.CurrentThread.IsBackground,"Polling Ended up in the main thread!");
+
UpdateStatus(PithosStatus.Syncing);
StatusNotification.Notify(new PollNotification());