0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-31 01:43:02 +08:00

Merge branch 'maint'

* maint:
  if TSC jumps backwards (in case of migration to a different CPU core) latency peak may occur -- fixed

Conflicts:
	src/app_thread.cpp
This commit is contained in:
Martin Sustrik 2010-09-26 13:36:05 +02:00
commit 7d5061798c

View File

@ -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;
}