0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 01:21:03 +01:00

put thread if in currentOp()

This commit is contained in:
Eliot Horowitz 2011-05-29 04:05:49 -04:00
parent 5ae386a221
commit 8b8427c898
2 changed files with 11 additions and 2 deletions

View File

@ -96,6 +96,11 @@ namespace mongo {
_mp(p) {
_connectionId = setThreadName(desc);
_curOp = new CurOp( this );
#ifndef _WINDOWS
stringstream temp;
temp << "0x" << hex << pthread_self();
_threadId = temp.str();
#endif
scoped_lock bl(clientsMutex);
clients.insert(this);
}
@ -387,9 +392,12 @@ namespace mongo {
clientStr << _remote.toString();
b.append("client", clientStr.str());
if ( _client )
if ( _client ) {
b.append( "desc" , _client->desc() );
if ( _client->_threadId.size() )
b.append( "threadId" , _client->_threadId );
}
if ( ! _message.empty() ) {
if ( _progressMeter.isActive() ) {
StringBuilder buf(128);

View File

@ -101,6 +101,7 @@ namespace mongo {
private:
ConnectionId _connectionId; // > 0 for things "conn", 0 otherwise
string _threadId; // "" on non support systems
CurOp * _curOp;
Context * _context;
bool _shutdown;