summaryrefslogtreecommitdiff
path: root/db/namespace.h
diff options
context:
space:
mode:
authorDwight <dwight@10gen.com>2010-09-28 17:49:40 -0400
committerDwight <dwight@10gen.com>2010-09-28 17:49:40 -0400
commitc595bf62aab72db689edc8e70e1ebaef71b09bd2 (patch)
tree64373b1a7299c8005061a40da86f66ec75767dcf /db/namespace.h
parent52cfae0accf094daf7d2ad8fbcce23afab4d99fd (diff)
downloadmongo-c595bf62aab72db689edc8e70e1ebaef71b09bd2.tar.gz
more intent to write declarations
Diffstat (limited to 'db/namespace.h')
-rw-r--r--db/namespace.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/db/namespace.h b/db/namespace.h
index 7479a21da24..ee15eea9887 100644
--- a/db/namespace.h
+++ b/db/namespace.h
@@ -260,11 +260,15 @@ namespace mongo {
bool isMultikey(int i) { return (multiKeyIndexBits & (((unsigned long long) 1) << i)) != 0; }
void setIndexIsMultikey(int i) {
dassert( i < NIndexesMax );
- multiKeyIndexBits |= (((unsigned long long) 1) << i);
+ unsigned long long x = ((unsigned long long) 1) << i;
+ if( multiKeyIndexBits & x ) return;
+ *dur::writing(&multiKeyIndexBits) |= x;
}
void clearIndexIsMultikey(int i) {
dassert( i < NIndexesMax );
- multiKeyIndexBits &= ~(((unsigned long long) 1) << i);
+ unsigned long long x = ((unsigned long long) 1) << i;
+ if( (multiKeyIndexBits & x) == 0 ) return;
+ *dur::writing(&multiKeyIndexBits) &= ~x;
}
/* add a new index. does not add to system.indexes etc. - just to NamespaceDetails.