Show
Ignore:
Timestamp:
04/26/08 08:35:32 (16 years ago)
Author:
ppalmers
Message:

convert to Util::Mutex

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/libieee1394/ieee1394service.cpp

    r1043 r1044  
    5454    , m_util_handle( 0 ) 
    5555    , m_port( -1 ) 
     56    , m_RHThread_lock( new Util::PosixMutex() ) 
    5657    , m_threadRunning( false ) 
    5758    , m_realtime ( false ) 
     
    6263    , m_pWatchdog ( new Util::Watchdog() ) 
    6364{ 
    64     pthread_mutex_init( &m_mutex, 0 ); 
    65  
    6665    for (unsigned int i=0; i<64; i++) { 
    6766        m_channels[i].channel=-1; 
     
    8180    , m_util_handle( 0 ) 
    8281    , m_port( -1 ) 
     82    , m_RHThread_lock( new Util::PosixMutex() ) 
    8383    , m_threadRunning( false ) 
    8484    , m_realtime ( rt ) 
     
    9191    , m_pWatchdog ( new Util::Watchdog() ) 
    9292{ 
    93     pthread_mutex_init( &m_mutex, 0 ); 
    94  
    9593    for (unsigned int i=0; i<64; i++) { 
    9694        m_channels[i].channel=-1; 
     
    130128        raw1394_destroy_handle( m_resetHandle ); 
    131129    } 
     130    delete m_RHThread_lock; 
    132131    if ( m_util_handle ) { 
    133132        raw1394_destroy_handle( m_util_handle ); 
     
    425424              nodeId, addr, length); 
    426425        #endif 
    427  
    428         return false; 
    429     } 
    430 
    431  
     426        return false; 
     427    } 
     428
    432429 
    433430bool 
     
    447444                 reinterpret_cast<fb_quadlet_t*>( buffer ) ); 
    448445} 
    449  
    450446 
    451447bool 
     
    466462    return raw1394_write( m_handle, nodeId, addr, length*4, data ) == 0; 
    467463} 
    468  
    469464 
    470465bool 
     
    664659 
    665660    int err=raw1394_arm_register(m_resetHandle, h->getStart(), 
    666                          h->getLength(), h->getBuffer(), (octlet_t)h, 
    667                          h->getAccessRights(), 
    668                          h->getNotificationOptions(), 
    669                          h->getClientTransactions()); 
     661                                 h->getLength(), h->getBuffer(), (octlet_t)h, 
     662                                 h->getAccessRights(), 
     663                                 h->getNotificationOptions(), 
     664                                 h->getClientTransactions()); 
    670665    if (err) { 
    671666        debugError("Failed to register ARM handler for 0x%016llX\n", h->getStart()); 
     
    808803        return true; 
    809804    } 
    810     pthread_mutex_lock( &m_mutex ); 
     805    m_RHThread_lock->Lock(); 
    811806    i = pthread_create( &m_thread, 0, rHThread, this ); 
    812     pthread_mutex_unlock( &m_mutex ); 
     807    m_RHThread_lock->Unlock(); 
    813808    if (i) { 
    814809        debugFatal("Could not start ieee1394 service thread\n"); 
     
    824819{ 
    825820    if ( m_threadRunning ) { 
    826         pthread_mutex_lock (&m_mutex); 
     821        m_RHThread_lock->Lock(); 
    827822        pthread_cancel (m_thread); 
    828823        pthread_join (m_thread, 0); 
    829         pthread_mutex_unlock (&m_mutex); 
     824        m_RHThread_lock->Unlock(); 
    830825        m_threadRunning = false; 
    831826    } 
  • trunk/libffado/src/libieee1394/ieee1394service.h

    r1043 r1044  
    311311                     byte_t request_type, unsigned int requested_length, 
    312312                     void *data); 
    313     bool armHandler( unsigned long arm_tag, 
     313    bool armHandler( unsigned long arm_tag, 
    314314                     byte_t request_type, unsigned int requested_length, 
    315315                     void *data); 
     
    323323 
    324324    pthread_t       m_thread; 
    325     pthread_mutex_t m_mutex
     325    Util::Mutex*    m_RHThread_lock
    326326    bool            m_threadRunning; 
    327327