summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKristina <kristina@10gen.com>2012-11-05 14:07:45 -0500
committerKristina <kristina@10gen.com>2012-11-05 14:25:11 -0500
commita3bba74665e0b03fd74612dabaaeac284f2a8bb4 (patch)
tree0534e5791d9b850d3b8b1fb0bb7294b18773f895 /src
parent68a6aa896cc5e57b30772aaa96cfc115d01b2d42 (diff)
downloadmongo-a3bba74665e0b03fd74612dabaaeac284f2a8bb4.tar.gz
SERVER-7501 Remove syncThread from client
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/client.cpp6
-rw-r--r--src/mongo/db/client.h9
-rw-r--r--src/mongo/db/queryoptimizer.cpp12
-rw-r--r--src/mongo/db/repl.cpp1
-rw-r--r--src/mongo/db/repl/rs_sync.cpp1
5 files changed, 4 insertions, 25 deletions
diff --git a/src/mongo/db/client.cpp b/src/mongo/db/client.cpp
index 46e78a8a671..e0d803cd757 100644
--- a/src/mongo/db/client.cpp
+++ b/src/mongo/db/client.cpp
@@ -41,8 +41,7 @@
#include "mongo/util/mongoutils/html.h"
namespace mongo {
-
- Client* Client::syncThread;
+
mongo::mutex& Client::clientsMutex = *(new mutex("clientsMutex"));
set<Client*>& Client::clients = *(new set<Client*>); // always be in clientsMutex when manipulating this
@@ -170,9 +169,6 @@ namespace mongo {
{
scoped_lock bl(clientsMutex);
clients.erase(this);
- if ( isSyncThread() ) {
- syncThread = 0;
- }
}
return false;
diff --git a/src/mongo/db/client.h b/src/mongo/db/client.h
index 38d74f5dba1..c06c0beb56b 100644
--- a/src/mongo/db/client.h
+++ b/src/mongo/db/client.h
@@ -56,7 +56,6 @@ namespace mongo {
/** the database's concept of an outside "client" */
class Client : public ClientBasic {
- static Client *syncThread;
public:
// always be in clientsMutex when manipulating this. killop stuff uses these.
static set<Client*>& clients;
@@ -82,14 +81,6 @@ namespace mongo {
*/
bool shutdown();
- /** set so isSyncThread() works */
- void iAmSyncThread() {
- wassert( syncThread == 0 );
- syncThread = this;
- }
- /** @return true if this client is the replication secondary pull thread. not used much, is used in create index sync code. */
- bool isSyncThread() const { return this == syncThread; }
-
string clientAddress(bool includePort=false) const;
const AuthenticationInfo * getAuthenticationInfo() const { return &_ai; }
AuthenticationInfo * getAuthenticationInfo() { return &_ai; }
diff --git a/src/mongo/db/queryoptimizer.cpp b/src/mongo/db/queryoptimizer.cpp
index 40855fbfcd2..1b1a7825b6b 100644
--- a/src/mongo/db/queryoptimizer.cpp
+++ b/src/mongo/db/queryoptimizer.cpp
@@ -1085,15 +1085,9 @@ doneCheckOrder:
( _qps.firstPlan()->utility() != QueryPlan::Impossible ) &&
!_qps.firstPlan()->indexed() &&
!_qps.firstPlan()->multikeyFrs().range( "_id" ).universal() ) {
- if ( cc().isSyncThread() ||
- str::contains( ns , ".system." ) ||
- str::startsWith( ns , "local." ) ) {
- // ok
- }
- else {
- warning()
- << "unindexed _id query on capped collection, "
- << "performance will be poor collection: " << ns << endl;
+ if (!str::contains( ns , ".system." ) && !str::startsWith( ns , "local." )) {
+ warning() << "unindexed _id query on capped collection, "
+ << "performance will be poor collection: " << ns << endl;
}
}
}
diff --git a/src/mongo/db/repl.cpp b/src/mongo/db/repl.cpp
index 48485c0f5e7..311d53d4530 100644
--- a/src/mongo/db/repl.cpp
+++ b/src/mongo/db/repl.cpp
@@ -1441,7 +1441,6 @@ namespace mongo {
void replSlaveThread() {
sleepsecs(1);
Client::initThread("replslave");
- cc().iAmSyncThread();
{
Lock::GlobalWrite lk;
diff --git a/src/mongo/db/repl/rs_sync.cpp b/src/mongo/db/repl/rs_sync.cpp
index 98419e83623..db9b8584f0b 100644
--- a/src/mongo/db/repl/rs_sync.cpp
+++ b/src/mongo/db/repl/rs_sync.cpp
@@ -712,7 +712,6 @@ namespace replset {
n++;
Client::initThread("rsSync");
- cc().iAmSyncThread(); // for isSyncThread() (which is used not used much, is used in secondary create index code
replLocalAuth();
theReplSet->syncThread();
cc().shutdown();