Add the thread fix as suggested in http://dast.nlanr.net/Projects/Iperf2.0/patch...
[openwrt/svn-archive/archive.git] / net / iperf / patches / 001-thread_library_fix.patch
1 --- iperf-2.0.2/compat/Thread.c 2005-05-03 08:15:51.000000000 -0700
2 +++ iperf-2.0.2.new/compat/Thread.c 2007-06-04 10:41:11.000000000 -0700
3 @@ -405,9 +405,13 @@
4 void thread_rest ( void ) {
5 #if defined( HAVE_THREAD )
6 #if defined( HAVE_POSIX_THREAD )
7 - // TODO add checks for sched_yield or pthread_yield and call that
8 - // if available
9 +
10 +#if defined( _POSIX_PRIORITY_SCHEDULING )
11 + sched_yield();
12 +#else
13 usleep( 0 );
14 +#endif
15 +
16 #else // Win32
17 SwitchToThread( );
18 #endif