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

libevent: Fix computation of the timeout value. #102

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

civodul
Copy link
Collaborator

@civodul civodul commented Jan 6, 2024

Until now, sleeping for 10s or more wouldn’t work on platforms where internal-time-units-per-second = 1e9, such as x86_64-linux-gnu.

On platforms where internal-time-units-per-second = 1e3, such as i586-pc-gnu, ‘tv’ would always be zero, leading to code that keeps spinning.

  • extensions/libevent.c (microsec_per_time_units): New variable.
    (run_event_loop): Fix computation of ‘tv_sec’ and ‘tv_usec’.
    (init_fibers_libevt): Initialize ‘microsec_per_time_units’.

Until now, sleeping for 10s or more wouldn’t work on platforms where
internal-time-units-per-second = 1e9, such as x86_64-linux-gnu.

On platforms where internal-time-units-per-second = 1e3, such as
i586-pc-gnu, ‘tv’ would always be zero, leading to code that keeps
spinning.

* extensions/libevent.c (microsec_per_time_units): New variable.
(run_event_loop): Fix computation of ‘tv_sec’ and ‘tv_usec’.
(init_fibers_libevt): Initialize ‘microsec_per_time_units’.
@aconchillo
Copy link
Collaborator

LGTM! Merging!

@aconchillo aconchillo merged commit 7e29729 into wingo:master Jan 8, 2024
4 checks passed
@civodul civodul deleted the libevent-timeout-value branch January 8, 2024 22:06
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