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

Replace system_clock with steady_clock #2559

Merged
merged 1 commit into from
Jan 12, 2022
Merged

Replace system_clock with steady_clock #2559

merged 1 commit into from
Jan 12, 2022

Conversation

llenck
Copy link
Contributor

@llenck llenck commented Dec 7, 2021

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Where used for timing, replace system_clock with steady_clock so that the updating of modules isn't affected by system clock changes.

The m_updated_at field of the mpd module was removed instead of having
its clock changed because it became unused in commit 645a314.

Related Issues & Documents

This fixes #857 and #1932. Also replaces PR #1725, since we don't need
our own implementation of condition_variable anymore since people who
update their polybar should have GCC 10 by now (which was released in may 2020).

Fixes #857
Fixes #1932
Closes #1725

Documentation (check all applicable)

  • This PR requires changes to the Wiki documentation (describe the changes)
  • This PR requires changes to the documentation inside the git repo (please add them to the PR).
  • Does not require documentation changes

This fixes #857 and #1932. Also replaces PR #1725, since we don't need
our own implementation of condition_variable anymore since people who
update their polybar should have GCC 10 by now.

The m_updated_at field of the mpd module was removed instead of having
its clock change because it became unused in commit 645a314.
@patrick96
Copy link
Member

Thanks for refreshing the PR :)

I'm not totally up-to-date on the bug. But what happens if someone builds polybar with gcc < 10. Do they just get the old behavior of the clock not being truly monotonic?

If so, I guess that's fine, we don't lose anything. But if this makes polybar not work properly with older gcc versions, we may have to rethink this. We aim to support any currently supported Ubuntu version (at least standard support), so we should try to make polybar work also on Ubuntu 18.04 with gcc 7.4

Copy link
Member

@patrick96 patrick96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Digging deeper into the original but report, it seems older GCC versions will still have the issue. That's fine.

I'll wait another day or two for you to comment, if you maybe have a different insight.

But otherwise, I think this is ready to merge. Thanks a lot 😃

@llenck
Copy link
Contributor Author

llenck commented Jan 12, 2022

Also did the digging (on gcc 7.5), and I came to the same conclusion as you did. Thanks for reviewing :)

@patrick96
Copy link
Member

Alright, thanks!

@patrick96 patrick96 merged commit 6e34265 into polybar:master Jan 12, 2022
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.

incorrect time after unhibernating Modules stop updating when system clock moves backwards
2 participants