Use 1 select() call and let it block #20
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
vusb-daemon spends a lot of time looping since it has two separate
select calls with short timeouts. Unify the two select calls and let it
block to avoid needless CPU usage.
xcdbus_pre_select is written to add to in-use fd_sets and nfds, so use
that feature. xcdbus_post_select will loop over its registered watches
checking for if the corresponding FD is set, so an extra FD in readfds
is fine. udevfd can then be checked for events as is done currently.
Signed-off-by: Jason Andryuk jandryuk@gmail.com
I haven't actually tested USB pass through with this change. Drivers from the ais build server seem to install in Windows, but I don't see a OpenXT USB Controller in device manager. The other PV drivers are running though.
Looking at strace after the change, the daemon seems to be reacting just fine.