Skip to content

Conversation

@benlangmuir
Copy link
Contributor

After we added processUnitsAndWait() as a separte entry point that
ultimately called the onFilesChange() method, it created a race on the
DoneInitState, which was accessed directly in the unit event callback
before jumping to the unit processing queue. Simplify that logic and fix
the race by using processUnitsAndWait() during initialization if we
desire waiting, and get rid of DoneInitState.

The previous approach was more flexible about allowing you to wait at an
arbitrary point after creating the IndexDatastore, but in practice we
were not using that ability, and it made it harder to understand the
synchronization required.

After we added processUnitsAndWait() as a separte entry point that
ultimately called the onFilesChange() method, it created a race on the
DoneInitState, which was accessed directly in the unit event callback
before jumping to the unit processing queue. Simplify that logic and fix
the race by using processUnitsAndWait() during initialization if we
desire waiting, and get rid of DoneInitState.

The previous approach was more flexible about allowing you to wait at an
arbitrary point after creating the IndexDatastore, but in practice we
were not using that ability, and it made it harder to understand the
synchronization required.
@benlangmuir benlangmuir requested a review from akyrtzi as a code owner May 11, 2020 23:27
@benlangmuir
Copy link
Contributor Author

@swift-ci please test

@benlangmuir
Copy link
Contributor Author

@swift-ci please test Linux

@benlangmuir
Copy link
Contributor Author

swiftlang/swift-corelibs-foundation#2793
@swift-ci please test Linux

@benlangmuir
Copy link
Contributor Author

swiftlang/swift#31733
@swift-ci please test Linux

@benlangmuir benlangmuir merged commit 19f8e11 into swiftlang:master May 12, 2020
@benlangmuir benlangmuir deleted the racey-init branch May 12, 2020 20:09
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