https://pytools.codeplex.com/workitem/2590
Create a fix that wraps FileSystemWatcher in our own class and implement an asynchronous Dispose(). If we queue the actual Dispose() on a background thread it can hang for as long as it likes until the program dies. The trick here is that we have to add a “IsDisposing” flag so we can recognise that we’re currently in this state, since otherwise there may be undetectable race conditions with file system events that are already in flight or come in before the Dispose completes.
Create a fix that wraps FileSystemWatcher in our own class and implement an asynchronous Dispose(). If we queue the actual Dispose() on a background thread it can hang for as long as it likes until the program dies. The trick here is that we have to add a “IsDisposing” flag so we can recognise that we’re currently in this state, since otherwise there may be undetectable race conditions with file system events that are already in flight or come in before the Dispose completes.