|
Make sure all parts of the macro added to mutex.h should be there:
commit: 9b37a3aa83655aa92c1d466e65500100e4d799cd
Code from mutex.h included here:
// Macro to get line as a string constant
|
#define MONGO_STRINGIFY(X) #X
|
// Double-expansion trick to get preproc to actually substitute __LINE__
|
#define _MONGO_LINE_STRING(LINE) MONGO_STRINGIFY( LINE )
|
#define MONGO_LINE_STRING _MONGO_LINE_STRING( __LINE__ )
|
|
// Mutex names should be as <file>::<line> string
|
#define MONGO_FILE_LINE __FILE__ "::" MONGO_LINE_STRING
|
Background - every mutex created needs a unique name (which is only used for debugging), and it's kind of a pain to keep the names up-to-date when classes get moved and refactored (particularly when doing initial coding). Instead, we can just use the file/line of the mutex initialization. dbclient.cpp is an example where the mutex names are a bit ad-hoc, have seen other places.
Suggestion - move to compiler.h, since this is not necessarily mutex specific?
|