[SERVER-9422] audit MONGO_FILE_LINE macro Created: 22/Apr/13  Updated: 11/Jun/15  Resolved: 11/Jun/15

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Greg Studer Assignee: Andy Schwerin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

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?



 Comments   
Comment by Andy Schwerin [ 11/Jun/15 ]

The macro is now unused, and will be removed in separate work.

Generated at Thu Feb 08 03:20:22 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.