Changeset 10169


Ignore:
Timestamp:
Feb 11, 2010, 4:07:13 AM (12 years ago)
Author:
charles
Message:

(trunk libT) tweak the shutdown code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/session.c

    r10143 r10169  
    15081508
    15091509static int
    1510 deadlineReached( const uint64_t deadline )
    1511 {
    1512     return tr_date( ) >= deadline;
     1510deadlineReached( const time_t deadline )
     1511{
     1512    return time( NULL ) >= deadline;
    15131513}
    15141514
     
    15181518tr_sessionClose( tr_session * session )
    15191519{
    1520     const int      maxwait_msec = SHUTDOWN_MAX_SECONDS * 1000;
    1521     const uint64_t deadline = tr_date( ) + maxwait_msec;
     1520    const time_t deadline = time( NULL ) + SHUTDOWN_MAX_SECONDS;
    15221521
    15231522    assert( tr_isSession( session ) );
     
    15511550        static tr_bool forced = FALSE;
    15521551        dbgmsg( "waiting for libtransmission thread to finish" );
    1553         tr_wait_msec( 100 );
     1552        tr_wait_msec( 500 );
    15541553        if( deadlineReached( deadline ) && !forced )
    15551554        {
    15561555            event_loopbreak( );
    15571556            forced = TRUE;
     1557
     1558            if( time( NULL ) >= deadline + 3 )
     1559                break;
    15581560        }
    15591561    }
Note: See TracChangeset for help on using the changeset viewer.