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:
parent
5ae386a221
commit
8b8427c898
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user