Changeset 978 for trunk/libffado/src/libieee1394
- Timestamp:
- 03/24/08 10:10:24 (16 years ago)
- Files:
-
- trunk/libffado/src/libieee1394/IsoHandlerManager.cpp (modified) (4 diffs)
- trunk/libffado/src/libieee1394/IsoHandlerManager.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/src/libieee1394/IsoHandlerManager.cpp
r967 r978 59 59 } 60 60 m_poll_nfds_shadow = 0; 61 62 #ifdef DEBUG 63 m_last_loop_entry = 0; 64 m_successive_short_loops = 0; 65 #endif 66 61 67 return true; 62 68 } … … 128 134 unsigned int m_poll_timeout = 10; 129 135 136 #ifdef DEBUG 137 uint64_t now = m_manager.get1394Service().getCurrentTimeAsUsecs(); 138 int diff = now - m_last_loop_entry; 139 if(diff < 100) { 140 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 141 "(%p) short loop detected (%d usec), cnt: %d\n", 142 this, diff, m_successive_short_loops); 143 m_successive_short_loops++; 144 if(m_successive_short_loops > 100) { 145 debugError("Shutting down runaway thread\n"); 146 return false; 147 } 148 } else { 149 // reset the counter 150 m_successive_short_loops = 0; 151 } 152 m_last_loop_entry = now; 153 #endif 154 130 155 // if some other thread requested a shadow map update, do it 131 156 if(request_update) { 132 157 updateShadowMapHelper(); 133 158 DEC_ATOMIC(&request_update); // ack the update 159 assert(request_update >= 0); 134 160 } 135 161 … … 217 243 if(m_poll_fds_shadow[i].revents) { 218 244 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, 219 " received events: %08X for (%d/%d, %p, %s)\n",220 m_poll_fds_shadow[i].revents,245 "(%p) received events: %08X for (%d/%d, %p, %s)\n", 246 this, m_poll_fds_shadow[i].revents, 221 247 i, m_poll_nfds_shadow, 222 248 m_IsoHandler_map_shadow[i], … … 233 259 // there might be some error condition 234 260 if (m_poll_fds_shadow[i].revents & POLLERR) { 235 debugWarning(" error on fd for %d\n",i);261 debugWarning("(%p) error on fd for %d\n", this, i); 236 262 } 237 263 if (m_poll_fds_shadow[i].revents & POLLHUP) { 238 debugWarning(" hangup on fd for %d\n",i);264 debugWarning("(%p) hangup on fd for %d\n", this, i); 239 265 } 240 266 } trunk/libffado/src/libieee1394/IsoHandlerManager.h
r967 r978 87 87 void updateShadowMapHelper(); 88 88 89 #ifdef DEBUG 90 uint64_t m_last_loop_entry; 91 int m_successive_short_loops; 92 #endif 93 89 94 // debug stuff 90 95 DECLARE_DEBUG_MODULE;