You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2017/07/21 16:52:55 UTC
[1/2] qpid-proton git commit: PROTON-1471: [C++ binding] Use
pn_proactor_now() to implement timestamp::now()
Repository: qpid-proton
Updated Branches:
refs/heads/master e6aaadb21 -> 6f88f525e
PROTON-1471: [C++ binding] Use pn_proactor_now() to implement timestamp::now()
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/6f88f525
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/6f88f525
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/6f88f525
Branch: refs/heads/master
Commit: 6f88f525e8800f6cbbba5c0a6cacf1d059176ef2
Parents: f6d4648
Author: Andrew Stitcher <as...@apache.org>
Authored: Thu Apr 27 13:05:14 2017 -0400
Committer: Andrew Stitcher <as...@apache.org>
Committed: Fri Jul 21 12:50:06 2017 -0400
----------------------------------------------------------------------
proton-c/bindings/cpp/src/timestamp.cpp | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/6f88f525/proton-c/bindings/cpp/src/timestamp.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/timestamp.cpp b/proton-c/bindings/cpp/src/timestamp.cpp
index da7c49f..437276e 100644
--- a/proton-c/bindings/cpp/src/timestamp.cpp
+++ b/proton-c/bindings/cpp/src/timestamp.cpp
@@ -20,29 +20,16 @@
#include "proton/timestamp.hpp"
#include "proton/internal/config.hpp"
+#include <proton/proactor.h>
#include <proton/types.h>
#include <iostream>
-#if PN_CPP_HAS_CHRONO
-#include <chrono>
-#else
-#include <time.h>
-#endif
-
namespace proton {
-#if PN_CPP_HAS_CHRONO
-timestamp timestamp::now() {
- using namespace std::chrono;
- return timestamp( duration_cast<std::chrono::milliseconds>(system_clock::now().time_since_epoch()).count() );
-}
-#else
-// Fallback with low (seconds) precision
timestamp timestamp::now() {
- return timestamp( time(0)*1000 );
+ return timestamp( pn_proactor_now() );
}
-#endif
std::ostream& operator<<(std::ostream& o, timestamp ts) { return o << ts.milliseconds(); }
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[2/2] qpid-proton git commit: PROTON-1524: Fix libuv proactor timer
tracking
Posted by as...@apache.org.
PROTON-1524: Fix libuv proactor timer tracking
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/f6d46482
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/f6d46482
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/f6d46482
Branch: refs/heads/master
Commit: f6d464822b154531d0d4005a4e5144b9a45ff9f3
Parents: e6aaadb
Author: Andrew Stitcher <as...@apache.org>
Authored: Fri Jul 21 12:48:31 2017 -0400
Committer: Andrew Stitcher <as...@apache.org>
Committed: Fri Jul 21 12:50:06 2017 -0400
----------------------------------------------------------------------
proton-c/src/proactor/libuv.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f6d46482/proton-c/src/proactor/libuv.c
----------------------------------------------------------------------
diff --git a/proton-c/src/proactor/libuv.c b/proton-c/src/proactor/libuv.c
index c0a4d8d..c70dbe7 100644
--- a/proton-c/src/proactor/libuv.c
+++ b/proton-c/src/proactor/libuv.c
@@ -1118,8 +1118,9 @@ void pn_proactor_disconnect(pn_proactor_t *p, pn_condition_t *cond) {
void pn_proactor_set_timeout(pn_proactor_t *p, pn_millis_t t) {
uv_mutex_lock(&p->lock);
p->timeout = t;
+ // This timeout *replaces* any existing timeout
+ if (p->timeout_state == TM_NONE) ++p->active;
p->timeout_state = TM_REQUEST;
- ++p->active;
uv_mutex_unlock(&p->lock);
notify(p);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org