Skip to content

DirectoryWatcher: add an implementation for Windows #1936

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 10, 2020

Conversation

compnerd
Copy link
Member

@compnerd compnerd commented Oct 9, 2020

This implements the directory watcher on Windows. It does the most
naive thing for simplicity. ReadDirectoryChangesW is used to monitor
the changes. However, in order to support interruption, we must use
overlapped IO, which allows us to use the blocking, synchronous
mechanism. We create a thread to post the notification to the consumer
to allow the monitoring to continue. The two threads communicate via a
locked queue.

Differential Revision: https://reviews.llvm.org/D88666
Reviewed By: Adrian McCarthy

(cherry picked from commit 5d74c43)

This implements the directory watcher on Windows.  It does the most
naive thing for simplicity.  ReadDirectoryChangesW is used to monitor
the changes.  However, in order to support interruption, we must use
overlapped IO, which allows us to use the blocking, synchronous
mechanism.  We create a thread to post the notification to the consumer
to allow the monitoring to continue.  The two threads communicate via a
locked queue.

Differential Revision: https://reviews.llvm.org/D88666
Reviewed By: Adrian McCarthy

(cherry picked from commit 5d74c43)
@compnerd
Copy link
Member Author

compnerd commented Oct 9, 2020

@swift-ci please test

@compnerd
Copy link
Member Author

compnerd commented Oct 9, 2020

CC: @hyp @jkorous-apple @akyrtzi

@hyp hyp self-requested a review October 10, 2020 00:00
@compnerd compnerd merged commit d38d7b6 into swiftlang:apple/stable/20200714 Oct 10, 2020
@compnerd compnerd deleted the watching branch October 10, 2020 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants