-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
change macOS < 10.12 clock to SYSTEM_CLOCK, fixes #2537 #2538
Conversation
Have found the SYSTEM_CLOCK definition way back in code from the year 2000, so it should work everywhere. |
Fails to build on the Travis OSX runs:
Also could you please rebase away the merge commit? |
Strange, thought the #ifdef for CLOCK_MONOTONIC the line 154 should work, got a fix coming. |
Doesn't the merge button have that option too? Can't find anything for it in the GitHub client |
Ok, I can squash them when merging |
Btw, std::chrono isn't useable because it would require a too new c++ Version? |
Now a few tests fail:
|
That looks like it's C++11 so yes, too new, sorry we got users on Solaris, AIX and the like |
Saw that, sorry for that. Thought its only used in clock.cpp and not exported. Btw, why is it exported? |
There's a reference in src/condition_variable.hpp as well |
Originally it was without the alt_ prefix and it was just a substitute for the missing system call. Then Apple added it, and it got mangled a bit. I'll clean it up one day... |
Oh, SublimeText hasn't found it there. |
src/condition_variable.hpp
Outdated
@@ -214,7 +214,7 @@ namespace zmq | |||
struct timespec timeout; | |||
|
|||
#if defined ZMQ_HAVE_OSX && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200 // less than macOS 10.12 | |||
alt_clock_gettime(CLOCK_REALTIME, &timeout); | |||
alt_clock_gettime(CALENDAR_CLOCK, &timeout); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why calendar clock? I think we want monotonic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clock_gettime uses the wall clock too there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you cancel all builds then please from this pr? Ill change it all to monotonic clocks then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks - this is a wrapper around pthread conditions, so monotonic clock is the right thing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
killed the builds
This should fix the issue in #2537 and also make it work with leap seconds