Add the thread fix as suggested in http://dast.nlanr.net/Projects/Iperf2.0/patch...
authorFlorian Fainelli <florian@openwrt.org>
Tue, 11 Sep 2007 06:53:10 +0000 (06:53 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Tue, 11 Sep 2007 06:53:10 +0000 (06:53 +0000)
SVN-Revision: 8742

net/iperf/patches/001-thread_library_fix.patch [new file with mode: 0644]

diff --git a/net/iperf/patches/001-thread_library_fix.patch b/net/iperf/patches/001-thread_library_fix.patch
new file mode 100644 (file)
index 0000000..189c57b
--- /dev/null
@@ -0,0 +1,18 @@
+--- iperf-2.0.2/compat/Thread.c        2005-05-03 08:15:51.000000000 -0700
++++ iperf-2.0.2.new/compat/Thread.c     2007-06-04 10:41:11.000000000 -0700
+@@ -405,9 +405,13 @@
+ void thread_rest ( void ) {
+ #if defined( HAVE_THREAD )
+ #if defined( HAVE_POSIX_THREAD )
+-    // TODO add checks for sched_yield or pthread_yield and call that
+-    // if available
++
++#if defined( _POSIX_PRIORITY_SCHEDULING )
++    sched_yield();
++#else
+     usleep( 0 );
++#endif
++
+ #else // Win32
+     SwitchToThread( );
+ #endif