summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/socket_base.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/socket_base.cpp b/src/socket_base.cpp
index 6bbff43..682062c 100644
--- a/src/socket_base.cpp
+++ b/src/socket_base.cpp
@@ -647,9 +647,11 @@ int zmq::socket_base_t::process_commands (bool block_, bool throttle_)
#else
#error
#endif
- // Check whether certain time have elapsed since last command
- // processing. If it didn't do nothing.
- if (current_time - last_processing_time <= max_command_delay)
+ // Check whether TSC haven't jumped backwards (in case of migration
+ // between CPU cores) and whether certain time have elapsed since
+ // last command processing. If it didn't do nothing.
+ if (current_time >= last_processing_time &&
+ current_time - last_processing_time <= max_command_delay)
return 0;
last_processing_time = current_time;
}