1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 09:37:56 +00:00

(trunk libT) poke at the newfound 100% cpu bug

This commit is contained in:
Charles Kerr 2010-03-06 20:15:23 +00:00
parent 3e79f4b3fe
commit ced3e2672f

View file

@ -287,6 +287,7 @@ tr_webThreadFunc( void * vsession )
msec = THREADFUNC_MAX_SLEEP_MSEC; msec = THREADFUNC_MAX_SLEEP_MSEC;
if( msec > 0 ) if( msec > 0 )
{ {
int usec;
int max_fd; int max_fd;
struct timeval t; struct timeval t;
fd_set r_fd_set, w_fd_set, c_fd_set; fd_set r_fd_set, w_fd_set, c_fd_set;
@ -299,8 +300,10 @@ tr_webThreadFunc( void * vsession )
if( msec > THREADFUNC_MAX_SLEEP_MSEC ) if( msec > THREADFUNC_MAX_SLEEP_MSEC )
msec = THREADFUNC_MAX_SLEEP_MSEC; msec = THREADFUNC_MAX_SLEEP_MSEC;
t.tv_sec = 0;
t.tv_usec = msec * 1000; usec = msec * 1000;
t.tv_sec = usec / 1000000;
t.tv_usec = usec % 1000000;
select( max_fd+1, &r_fd_set, &w_fd_set, &c_fd_set, &t ); select( max_fd+1, &r_fd_set, &w_fd_set, &c_fd_set, &t );
} }