Changeset 9859


Ignore:
Timestamp:
Jan 4, 2010, 9:05:02 AM (12 years ago)
Author:
charles
Message:

(trunk libT) consistency tweak: rename tr_global{Lock,Unlock,IsLocked?} as tr_session{Lock,Unlock,IsLocked?}

Location:
trunk/libtransmission
Files:
7 edited

Legend:

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

    r9834 r9859  
    131131    if( io->canRead )
    132132    {
    133         tr_globalLock( session );
     133        tr_sessionLock( session );
    134134
    135135        while( !done && !err )
     
    169169        }
    170170
    171         tr_globalUnlock( session );
     171        tr_sessionUnlock( session );
    172172    }
    173173
  • trunk/libtransmission/peer-mgr.c

    r9847 r9859  
    218218managerLock( const struct tr_peerMgr * manager )
    219219{
    220     tr_globalLock( manager->session );
     220    tr_sessionLock( manager->session );
    221221}
    222222
     
    224224managerUnlock( const struct tr_peerMgr * manager )
    225225{
    226     tr_globalUnlock( manager->session );
     226    tr_sessionUnlock( manager->session );
    227227}
    228228
     
    242242torrentIsLocked( const Torrent * t )
    243243{
    244     return tr_globalIsLocked( t->manager->session );
     244    return tr_sessionIsLocked( t->manager->session );
    245245}
    246246
  • trunk/libtransmission/session.c

    r9850 r9859  
    917917
    918918void
    919 tr_globalLock( tr_session * session )
     919tr_sessionLock( tr_session * session )
    920920{
    921921    assert( tr_isSession( session ) );
     
    925925
    926926void
    927 tr_globalUnlock( tr_session * session )
     927tr_sessionUnlock( tr_session * session )
    928928{
    929929    assert( tr_isSession( session ) );
     
    933933
    934934tr_bool
    935 tr_globalIsLocked( const tr_session * session )
     935tr_sessionIsLocked( const tr_session * session )
    936936{
    937937    return tr_isSession( session ) && tr_lockHave( session->lock );
     
    17251725    assert( tr_isSession( session ) );
    17261726
    1727     tr_globalLock( session );
     1727    tr_sessionLock( session );
    17281728    tr_sharedTraversalEnable( session->shared, enabled );
    1729     tr_globalUnlock( session );
     1729    tr_sessionUnlock( session );
    17301730}
    17311731
  • trunk/libtransmission/session.h

    r9850 r9859  
    154154                                         const struct tr_address * addr );
    155155
    156 void         tr_globalLock( tr_session * );
     156void         tr_sessionLock( tr_session * );
    157157
    158 void         tr_globalUnlock( tr_session * );
     158void         tr_sessionUnlock( tr_session * );
    159159
    160 tr_bool      tr_globalIsLocked( const tr_session * );
     160tr_bool      tr_sessionIsLocked( const tr_session * );
    161161
    162162const struct tr_address*  tr_sessionGetPublicAddress( const tr_session *, int tr_af_type );
  • trunk/libtransmission/torrent.c

    r9855 r9859  
    596596    assert( session != NULL );
    597597
    598     tr_globalLock( session );
     598    tr_sessionLock( session );
    599599
    600600    tor->session   = session;
     
    688688        torrentStart( tor );
    689689
    690     tr_globalUnlock( session );
     690    tr_sessionUnlock( session );
    691691}
    692692
     
    12561256    assert( !tor->isRunning );
    12571257
    1258     tr_globalLock( session );
     1258    tr_sessionLock( session );
    12591259
    12601260    tr_peerMgrRemoveTorrent( tor );
     
    12881288    tr_free( tor );
    12891289
    1290     tr_globalUnlock( session );
     1290    tr_sessionUnlock( session );
    12911291}
    12921292
     
    13021302    assert( tr_isTorrent( tor ) );
    13031303
    1304     tr_globalLock( tor->session );
     1304    tr_sessionLock( tor->session );
    13051305
    13061306    /** If we had local data before, but it's disappeared,
     
    13281328    }
    13291329
    1330     tr_globalUnlock( tor->session );
     1330    tr_sessionUnlock( tor->session );
    13311331}
    13321332
     
    13451345    assert( tr_isTorrent( tor ) );
    13461346
    1347     tr_globalLock( tor->session );
     1347    tr_sessionLock( tor->session );
    13481348
    13491349    if( !tor->isRunning )
     
    13651365    }
    13661366
    1367     tr_globalUnlock( tor->session );
     1367    tr_sessionUnlock( tor->session );
    13681368}
    13691369
     
    14101410
    14111411    assert( tr_isTorrent( tor ) );
    1412     tr_globalLock( tor->session );
     1412    tr_sessionLock( tor->session );
    14131413
    14141414    /* if the torrent's already being verified, stop it */
     
    14261426    tr_verifyAdd( tor, torrentRecheckDoneCB );
    14271427
    1428     tr_globalUnlock( tor->session );
     1428    tr_sessionUnlock( tor->session );
    14291429}
    14301430
     
    14721472    if( tr_isTorrent( tor ) )
    14731473    {
    1474         tr_globalLock( tor->session );
     1474        tr_sessionLock( tor->session );
    14751475
    14761476        tor->isRunning = 0;
     
    14781478        tr_runInEventThread( tor->session, stopTorrent, tor );
    14791479
    1480         tr_globalUnlock( tor->session );
     1480        tr_sessionUnlock( tor->session );
    14811481    }
    14821482}
     
    15131513        tr_session * session = tor->session;
    15141514        assert( tr_isSession( session ) );
    1515         tr_globalLock( session );
     1515        tr_sessionLock( session );
    15161516
    15171517        tr_torrentClearCompletenessCallback( tor );
    15181518        tr_runInEventThread( session, closeTorrent, tor );
    15191519
    1520         tr_globalUnlock( session );
     1520        tr_sessionUnlock( session );
    15211521    }
    15221522}
  • trunk/libtransmission/torrent.h

    r9847 r9859  
    1919
    2020#include "completion.h" /* tr_completion */
    21 #include "session.h" /* tr_globalLock(), tr_globalUnlock() */
     21#include "session.h" /* tr_sessionLock(), tr_sessionUnlock() */
    2222#include "utils.h" /* TR_GNUC_PRINTF */
    2323
     
    294294static inline void tr_torrentLock( const tr_torrent * tor )
    295295{
    296     tr_globalLock( tor->session );
     296    tr_sessionLock( tor->session );
    297297}
    298298
    299299static inline void tr_torrentUnlock( const tr_torrent * tor )
    300300{
    301     tr_globalUnlock( tor->session );
     301    tr_sessionUnlock( tor->session );
    302302}
    303303
  • trunk/libtransmission/tr-dht.c

    r9849 r9859  
    603603    if( event == DHT_EVENT_VALUES || event == DHT_EVENT_VALUES6 ) {
    604604        tr_torrent *tor;
    605         tr_globalLock( session );
     605        tr_sessionLock( session );
    606606        tor = tr_torrentFindFromHash( session, info_hash );
    607607        if( tor && tr_torrentAllowsDHT( tor ))
     
    620620                      event == DHT_EVENT_VALUES6 ? " IPv6" : "");
    621621        }
    622         tr_globalUnlock( session );
     622        tr_sessionUnlock( session );
    623623    } else if( event == DHT_EVENT_SEARCH_DONE ||
    624624               event == DHT_EVENT_SEARCH_DONE6) {
Note: See TracChangeset for help on using the changeset viewer.