Ignore:
Timestamp:
Feb 6, 2007, 5:37:48 AM (16 years ago)
Author:
joshe
Message:

Remove natpmp and upnp locks and rely on the shared lock.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/natpmp.c

    r1460 r1463  
    8383    int                newport;
    8484    int                mappedport;
    85     tr_lock_t          lock;
    8685    uint64_t           renew;
    8786    tr_natpmp_req_t *  req;
     
    150149    }
    151150
    152     tr_lockInit( &pmp->lock );
    153 
    154151    return pmp;
    155152}
     
    158155tr_natpmpStart( tr_natpmp_t * pmp )
    159156{
    160     tr_lockLock( &pmp->lock );
    161 
    162157    if( !pmp->active )
    163158    {
     
    169164        }
    170165    }
    171 
    172     tr_lockUnlock( &pmp->lock );
    173166}
    174167
     
    176169tr_natpmpStop( tr_natpmp_t * pmp )
    177170{
    178     tr_lockLock( &pmp->lock );
    179 
    180171    if( pmp->active )
    181172    {
     
    213204        }
    214205    }
    215 
    216     tr_lockUnlock( &pmp->lock );
    217206}
    218207
     
    221210{
    222211    int ret;
    223 
    224     tr_lockLock( &pmp->lock );
    225 
    226212   
    227213    if( !pmp->active )
     
    260246    }
    261247
    262     tr_lockUnlock( &pmp->lock );
    263 
    264248    return ret;
    265249}
     
    268252tr_natpmpForwardPort( tr_natpmp_t * pmp, int port )
    269253{
    270     tr_lockLock( &pmp->lock );
    271254    tr_inf( "nat-pmp set port %i", port );
    272255    pmp->newport = port;
    273     tr_lockUnlock( &pmp->lock );
    274256}
    275257
     
    281263    tr_natpmpPulse( pmp, NULL );
    282264
    283     tr_lockLock( &pmp->lock );
    284265    killreq( &pmp->req );
    285     tr_lockClose( &pmp->lock );
    286266    free( pmp );
    287267}
     
    290270tr_natpmpPulse( tr_natpmp_t * pmp, int * publicPort )
    291271{
    292     tr_lockLock( &pmp->lock );
    293 
    294272    if( 0 <= pmp->mcastfd )
    295273    {
     
    461439        *publicPort = -1;
    462440    }
    463 
    464     tr_lockUnlock( &pmp->lock );
    465441}
    466442
Note: See TracChangeset for help on using the changeset viewer.