Changeset 1044 for trunk/libffado/src/libieee1394
- Timestamp:
- 04/26/08 08:35:32 (16 years ago)
- Files:
-
- trunk/libffado/src/libieee1394/ieee1394service.cpp (modified) (11 diffs)
- trunk/libffado/src/libieee1394/ieee1394service.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/src/libieee1394/ieee1394service.cpp
r1043 r1044 54 54 , m_util_handle( 0 ) 55 55 , m_port( -1 ) 56 , m_RHThread_lock( new Util::PosixMutex() ) 56 57 , m_threadRunning( false ) 57 58 , m_realtime ( false ) … … 62 63 , m_pWatchdog ( new Util::Watchdog() ) 63 64 { 64 pthread_mutex_init( &m_mutex, 0 );65 66 65 for (unsigned int i=0; i<64; i++) { 67 66 m_channels[i].channel=-1; … … 81 80 , m_util_handle( 0 ) 82 81 , m_port( -1 ) 82 , m_RHThread_lock( new Util::PosixMutex() ) 83 83 , m_threadRunning( false ) 84 84 , m_realtime ( rt ) … … 91 91 , m_pWatchdog ( new Util::Watchdog() ) 92 92 { 93 pthread_mutex_init( &m_mutex, 0 );94 95 93 for (unsigned int i=0; i<64; i++) { 96 94 m_channels[i].channel=-1; … … 130 128 raw1394_destroy_handle( m_resetHandle ); 131 129 } 130 delete m_RHThread_lock; 132 131 if ( m_util_handle ) { 133 132 raw1394_destroy_handle( m_util_handle ); … … 425 424 nodeId, addr, length); 426 425 #endif 427 428 return false; 429 } 430 } 431 426 return false; 427 } 428 } 432 429 433 430 bool … … 447 444 reinterpret_cast<fb_quadlet_t*>( buffer ) ); 448 445 } 449 450 446 451 447 bool … … 466 462 return raw1394_write( m_handle, nodeId, addr, length*4, data ) == 0; 467 463 } 468 469 464 470 465 bool … … 664 659 665 660 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()); 670 665 if (err) { 671 666 debugError("Failed to register ARM handler for 0x%016llX\n", h->getStart()); … … 808 803 return true; 809 804 } 810 pthread_mutex_lock( &m_mutex);805 m_RHThread_lock->Lock(); 811 806 i = pthread_create( &m_thread, 0, rHThread, this ); 812 pthread_mutex_unlock( &m_mutex);807 m_RHThread_lock->Unlock(); 813 808 if (i) { 814 809 debugFatal("Could not start ieee1394 service thread\n"); … … 824 819 { 825 820 if ( m_threadRunning ) { 826 pthread_mutex_lock (&m_mutex);821 m_RHThread_lock->Lock(); 827 822 pthread_cancel (m_thread); 828 823 pthread_join (m_thread, 0); 829 pthread_mutex_unlock (&m_mutex);824 m_RHThread_lock->Unlock(); 830 825 m_threadRunning = false; 831 826 } trunk/libffado/src/libieee1394/ieee1394service.h
r1043 r1044 311 311 byte_t request_type, unsigned int requested_length, 312 312 void *data); 313 bool armHandler( 313 bool armHandler( unsigned long arm_tag, 314 314 byte_t request_type, unsigned int requested_length, 315 315 void *data); … … 323 323 324 324 pthread_t m_thread; 325 pthread_mutex_t m_mutex;325 Util::Mutex* m_RHThread_lock; 326 326 bool m_threadRunning; 327 327