Changeset 474

Show
Ignore:
Timestamp:
05/23/07 14:19:19 (14 years ago)
Author:
ppalmers
Message:

ringbuffer usage can be turned off using a preprocessor directive

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/echoaudio/src/debugmodule/debugmodule.cpp

    r445 r474  
    3030#include <iostream> 
    3131 
     32#define DO_MESSAGE_BUFFER_PRINT 
     33 
    3234using namespace std; 
    3335 
     
    341343        return; 
    342344    } 
     345 
     346#ifdef DO_MESSAGE_BUFFER_PRINT 
    343347    if (pthread_mutex_trylock(&mb_write_lock) == 0) { 
    344348        strncpy(mb_buffers[mb_inbuffer], msg, MB_BUFFERSIZE); 
     
    351355        mb_overruns++; // skip the atomicness for now 
    352356    } 
     357#else 
     358    fprintf(stderr,msg); 
     359#endif 
    353360} 
    354361 
     
    370377    } 
    371378 
     379#ifdef DO_MESSAGE_BUFFER_PRINT 
    372380    if (pthread_mutex_trylock(&mb_write_lock) == 0) { 
    373381        strncpy(mb_buffers[mb_inbuffer], msg, MB_BUFFERSIZE); 
     
    380388        mb_overruns++; // skip the atomicness for now 
    381389    } 
     390#else 
     391    fprintf(stderr,msg); 
     392#endif 
    382393} 
    383394