Skip to content
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

More cleanups cfgs in unix module #1813

Merged
merged 11 commits into from
Jun 24, 2024
Merged

More cleanups cfgs in unix module #1813

merged 11 commits into from
Jun 24, 2024

Conversation

Thomasdezeeuw
Copy link
Collaborator

Similar to the changes made the cfgs for the selector this commit set is for the waker type.

The waker implementation are split into multiple files, one per implementation, matching the selector split. The mess in src/sys/unix/waker.rs is cleaned up and moved to src/sys/unix/mod.rs and src/sys/unix/selector/*.rs, see individual commits for more details.

And make it not pub, but pub(crate).

No functional changes.
Also makes the pub -> pub(crate) change.

No functional changes.
Also here the change from pub to pub(crate) was made.

No functional changes.
And rename it to WakerInternal where needed.
This is because we're going to use a similar list of cfg attributes to
the list we use for selector, so it's beneficial to have them close
together.
So we don't have to define it twice. Similar change as we made for the
selector module.
To be used in the poll implementation.
Same as what we did for the selector.

But for the waker it's a little more complicated due to the poll(2)
implementation. That needs to wrap the Waker type to use it's internal
waker, compared to kqueue and epoll which just reexport the Waker
directly.

This logical of what waker to use is now moved to the selector module.
For kqueue and epoll it's a simple export, for poll it's a special type
that call the internal waker. This special poll waker used to be the
fdbased waker.

All these changes (hopefully) add up to no changes at all. All the
supported targets should continue to work with all configurations.
However it should be easier to port to new targets without having to
deal with the clusterfuck that was the old sys::unix::waker module.
Make that clear in the code.
@Thomasdezeeuw
Copy link
Collaborator Author

@Darksonn hopefully this is the last of the cfg cleanups :)

@Thomasdezeeuw Thomasdezeeuw merged commit 1ce1545 into master Jun 24, 2024
59 checks passed
@Thomasdezeeuw Thomasdezeeuw deleted the cleanup-cfgs-p2 branch June 24, 2024 10:38
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.

None yet

2 participants