Changeset 3884


Ignore:
Timestamp:
Nov 19, 2007, 4:30:31 PM (15 years ago)
Author:
charles
Message:

remove more dead code. this scaffolding was to let libevent play nice back when we had one thread per torrent

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/trevent.c

    r3830 r3884  
    6666    TR_EV_EVHTTP_MAKE_REQUEST,
    6767    TR_EV_TIMER_ADD,
    68     TR_EV_TIMER_DEL,
    6968    TR_EV_EXEC
    7069};
     
    130129                timeout_add( &cmd->timer->event, &cmd->timer->tv );
    131130                ++eh->timerCount;
    132                 break;
    133 
    134             case TR_EV_TIMER_DEL:
    135                 event_del( &cmd->timer->event );
    136                 tr_free( cmd->timer );
    137                 --eh->timerCount;
    138131                break;
    139132
     
    321314    /* destroy the timer directly or via the command queue */
    322315    if( timer!=NULL && !timer->inCallback ) {
    323         if( tr_amInThread( timer->eh->thread ) ) {
    324             void * del = tr_list_remove( &timer->eh->commands, timer, timerCompareFunc );
    325             --timer->eh->timerCount;
    326             event_del( &timer->event );
    327             tr_free( timer );
    328             tr_free( del );
    329         } else {
    330             struct tr_event_command * cmd = tr_new0( struct tr_event_command, 1 );
    331             cmd->mode = TR_EV_TIMER_DEL;
    332             cmd->timer = timer;
    333             pushList( timer->eh, cmd );
    334         }
     316        void * del;
     317        assert( tr_amInEventThread( timer->eh->h ) );
     318        del = tr_list_remove( &timer->eh->commands, timer, timerCompareFunc );
     319        --timer->eh->timerCount;
     320        event_del( &timer->event );
     321        tr_free( timer );
     322        tr_free( del );
    335323    }
    336324}
Note: See TracChangeset for help on using the changeset viewer.