-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lock all read/writes of selected keys via the public key set
This ensures that the selector and its clients use the same lock to synchronize access to the selected keys Changes: * Always lock on `selectedKeysPublic` to be consistent with clients * Synchronize on `selectedKeysPublic` when adding or clearing selected keys * Reorder the calls to `consumeAllBytesAfterPoll` and `selectedKeysPublic.clear()` after polling in order to push down the lock on `selectedKeysPublic`. This should be safe since neither the channel closing loop nor `consumeAllBytesAfterPoll` operates on the selected key set * Remove redudnant use of `synchronized` on methods that are always called under a lock on `this`. Use assertions to document what locks are required for the given method instead
- Loading branch information
1 parent
6818639
commit 70e51c4
Showing
1 changed file
with
71 additions
and
55 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