Changeset 7811


Ignore:
Timestamp:
Jan 28, 2009, 7:35:39 PM (12 years ago)
Author:
charles
Message:

(trunk libT) add more assertions to ensure that the libevent calls are all being made from the same thread

Location:
trunk/libtransmission
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-io.c

    r7803 r7811  
    347347    tr_peerIo * io;
    348348
     349    assert( session != NULL );
     350    assert( session->events != NULL );
     351    assert( tr_amInEventThread( session ) );
     352
    349353    if( socket >= 0 )
    350354        tr_netSetTOS( socket, session->peerSocketTOS );
     
    849853{
    850854    assert( tr_amInEventThread( io->session ) );
     855    assert( io->session != NULL );
    851856    assert( io->session->events != NULL );
    852857    assert( event_initialized( &io->event_read ) );
     
    872877{
    873878    assert( tr_amInEventThread( io->session ) );
     879    assert( io->session != NULL );
    874880    assert( io->session->events != NULL );
    875881    assert( event_initialized( &io->event_read ) );
  • trunk/libtransmission/trevent.c

    r7803 r7811  
    347347    tr_timer * timer;
    348348
    349     assert( session );
    350     assert( session->events );
     349    assert( session != NULL );
     350    assert( session->events != NULL );
    351351
    352352    timer = tr_new0( tr_timer, 1 );
     
    380380                     void func( void* ), void * user_data )
    381381{
    382     assert( session );
    383     assert( session->events );
     382    assert( session != NULL );
     383    assert( session->events != NULL );
    384384
    385385    if( tr_amInThread( session->events->thread ) )
  • trunk/libtransmission/web.c

    r7786 r7811  
    247247{
    248248    struct timeval interval;
     249
     250    assert( tr_amInEventThread( g->session ) );
     251    assert( g->session != NULL );
     252    assert( g->session->events != NULL );
     253
    249254    stop_timer( g );
    250255    dbgmsg( "adding a timeout for %ld seconds from now", g->timer_ms/1000L );
     
    358363                   | (( action & CURL_POLL_IN ) ? EV_READ : 0 )
    359364                   | (( action & CURL_POLL_OUT ) ? EV_WRITE : 0 );
     365
     366    assert( tr_amInEventThread( g->session ) );
     367    assert( g->session != NULL );
     368    assert( g->session->events != NULL );
     369
    360370    dbgmsg( "setsock: fd is %d, curl action is %d, libevent action is %d",
    361371            sockfd, action, kind );
Note: See TracChangeset for help on using the changeset viewer.