0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 00:56:44 +01:00

separate counter for RARELY -- really only a partial "fix".

(we want these macros to be fast that is why it is as it is)
This commit is contained in:
Dwight 2009-02-11 12:25:28 -05:00
parent 4dfbeda3db
commit d11d75e7ef
2 changed files with 3 additions and 1 deletions

View File

@ -289,10 +289,11 @@ namespace mongo {
#define DEBUGGING if( 0 )
extern unsigned occasion;
extern unsigned occasionR;
extern unsigned once;
#define OCCASIONALLY if( ++occasion % 16 == 0 )
#define RARELY if( ++occasion % 128 == 0 )
#define RARELY if( ++occasionR % 128 == 0 )
#define ONCE if( ++once == 1 )
#if defined(_WIN32)

View File

@ -31,6 +31,7 @@ namespace mongo {
boost::mutex Logstream::mutex;
unsigned occasion = 0;
unsigned occasionR = 0;
unsigned once = 0;
bool goingAway = false;