-
Notifications
You must be signed in to change notification settings - Fork 627
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cancellation to NIOThreadPool's async runIfActive (#2679)
Motivation: To dedupe the thread pool from NIOFileSystem and NIOPosix, the one from NIOPosix needs to gain support for cancellation for its async `runIfActive` function. Modification: - Generate a work ID when submitting async work to the pool, add that ID to a set in the cancellation handler - Check the existence of the ID in the cancel set when dequeuing the work Result: Queued NIOThreadPool tasks can be cancelled before they are run.
- Loading branch information
Showing
3 changed files
with
91 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters