summaryrefslogtreecommitdiff
path: root/recipes/iperf/iperf-2.0.4/009-delayloop.patch
diff options
context:
space:
mode:
authorRoman I Khimov <khimov@altell.ru>2010-05-28 16:34:33 +0400
committerRoman I Khimov <khimov@altell.ru>2010-06-10 23:18:54 +0400
commitc10c33f86903c93611023197a7f812459c2dfe2d (patch)
tree706bf9475724a223bc0c2d4b942dc4d0f3c938e5 /recipes/iperf/iperf-2.0.4/009-delayloop.patch
parentd5cdf92bba08438c248aae145503de5fd829720a (diff)
iperf 2.0.4: import Debian patches
Fixes a lot of real bugs. Signed-off-by: Roman I Khimov <khimov@altell.ru>
Diffstat (limited to 'recipes/iperf/iperf-2.0.4/009-delayloop.patch')
-rw-r--r--recipes/iperf/iperf-2.0.4/009-delayloop.patch19
1 files changed, 19 insertions, 0 deletions
diff --git a/recipes/iperf/iperf-2.0.4/009-delayloop.patch b/recipes/iperf/iperf-2.0.4/009-delayloop.patch
new file mode 100644
index 0000000000..a1f8dac9f5
--- /dev/null
+++ b/recipes/iperf/iperf-2.0.4/009-delayloop.patch
@@ -0,0 +1,19 @@
+# by Kirby Zhou < kirbyzhou \x40 sohu-rd.com >
+# using sched_yield to schedule other threads, so multiple iperf can run simultaneously
+# using usleep with delay-loop between 2 package is long than 1.25ms.
+--- iperf-2.0.4-4/compat/delay.cpp 2009-07-06 12:02:24.166276642 +0200
++++ iperf-2.0.4/compat/delay.cpp 2009-07-06 12:01:33.858384005 +0200
+@@ -69,6 +69,13 @@ void delay_loop( unsigned long usec ) {
+
+ Timestamp now;
+ while ( now.before( end ) ) {
++ long diff = end.subUsec(now);
++ if (diff >= 1250) {
++ usleep(0);
++ }
++ if (diff >= 2) {
++ sched_yield();
++ }
+ now.setnow();
+ }
+ }