Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Assert codes updated by buildscript

  • Loading branch information...
commit d07386582932b442c9bab58dec1e44d2b67c0d6b 1 parent 9e1d746
@renctan renctan authored
View
6 src/mongo/db/d_concurrency.cpp
@@ -693,7 +693,7 @@ namespace mongo {
}
Lock::DBWrite::UpgradeToExclusive::UpgradeToExclusive() {
- fassert( 0, lockState().threadState() == 'w' );
+ fassert( 16187, lockState().threadState() == 'w' );
_gotUpgrade = q.w_to_X();
if ( _gotUpgrade )
lockState().locked('W');
@@ -701,12 +701,12 @@ namespace mongo {
Lock::DBWrite::UpgradeToExclusive::~UpgradeToExclusive() {
if ( _gotUpgrade ) {
- fassert( 0, lockState().threadState() == 'W' );
+ fassert( 16188, lockState().threadState() == 'W' );
q.X_to_w();
lockState().locked('w');
}
else {
- fassert( 0, lockState().threadState() == 'w' );
+ fassert( 16189, lockState().threadState() == 'w' );
}
}
View
18 src/mongo/dbtests/threadedtests.cpp
@@ -74,7 +74,7 @@ namespace ThreadedTests {
numUpgraders(myNumUpgraders),
numNoiseMakers(myNumNoiseMakers) {
- fassert(0, numUpgraders > 0);
+ fassert(16190, numUpgraders > 0);
}
int numRounds;
@@ -95,8 +95,8 @@ namespace ThreadedTests {
void writeAndUpgrade(int threadNumber, int currentIteration);
bool allDone() {
- fassert(0, _numNoiseMakersFinished <= _numNoiseMakersDesired);
- fassert(0, _numUpgradersFinished <= _numUpgradersDesired);
+ fassert(16191, _numNoiseMakersFinished <= _numNoiseMakersDesired);
+ fassert(16192, _numUpgradersFinished <= _numUpgradersDesired);
if (_numNoiseMakersFinished < _numNoiseMakersDesired)
return false;
if (_numUpgradersFinished < _numUpgradersDesired)
@@ -166,9 +166,9 @@ namespace ThreadedTests {
}
LockStepWriteUpgradeTest::~LockStepWriteUpgradeTest() {
- fassert(0, _numThreadsAtBarrier == 0);
- fassert(0, _numUpgradersFinished == _numUpgradersDesired);
- fassert(0, _numNoiseMakersFinished == _numNoiseMakersDesired);
+ fassert(16193, _numThreadsAtBarrier == 0);
+ fassert(16194, _numUpgradersFinished == _numUpgradersDesired);
+ fassert(16195, _numNoiseMakersFinished == _numNoiseMakersDesired);
}
void LockStepWriteUpgradeTest::run() {
@@ -198,7 +198,7 @@ namespace ThreadedTests {
{
boost::mutex::scoped_lock lk(_m);
- fassert(0, _numNoiseMakersFinished < _numNoiseMakersDesired);
+ fassert(16196, _numNoiseMakersFinished < _numNoiseMakersDesired);
++_numNoiseMakersFinished;
maybeSignalAllDone();
}
@@ -222,7 +222,7 @@ namespace ThreadedTests {
{
boost::mutex::scoped_lock lk(_m);
- fassert(0, _numUpgradersFinished < _numUpgradersDesired);
+ fassert(16197, _numUpgradersFinished < _numUpgradersDesired);
++_numUpgradersFinished;
maybeSignalAllDone();
}
@@ -275,7 +275,7 @@ namespace ThreadedTests {
void LockStepWriteUpgradeTest::finishRound(bool skippedUpgrade, bool gotUpgrade) {
boost::mutex::scoped_lock lk(_m);
- fassert( 0, !(skippedUpgrade && gotUpgrade) );
+ fassert( 16198, !(skippedUpgrade && gotUpgrade) );
if (skippedUpgrade) {
++_numBypassersThisRound;
}
View
2  src/mongo/util/assert_util.h
@@ -194,7 +194,7 @@ namespace mongo {
could be slow.
*/
#if defined(_DEBUG)
-# define MONGO_dassert(x) fassert(0, (x))
+# define MONGO_dassert(x) fassert(16199, (x))
#else
# define MONGO_dassert(x)
#endif
View
46 src/mongo/util/concurrency/qlock.h
@@ -118,13 +118,13 @@ namespace mongo {
case 'w' : return them == 'W' || them == 'R' || them == 'X';
case 'r' : return them == 'W' || them == 'X';
case 'X' : return true;
- default : fassertFailed(0);
+ default : fassertFailed(16200);
}
return false;
}
inline void QLock::notifyWeUnlocked(char me) {
- fassert(0, W.n == 0);
+ fassert(16201, W.n == 0);
if ( me == 'X' ) {
X.c.notify_all();
}
@@ -217,7 +217,7 @@ namespace mongo {
if (W_legal()) {
W.n++;
- fassert( 0, W.n == 1 );
+ fassert( 16202, W.n == 1 );
return true;
}
@@ -228,9 +228,9 @@ namespace mongo {
// downgrade from W state to R state
inline void QLock::W_to_R() {
boost::mutex::scoped_lock lk(m);
- fassert(0, W.n == 1);
- fassert(0, R.n == 0);
- fassert(0, U.n == 0);
+ fassert(16203, W.n == 1);
+ fassert(16204, R.n == 0);
+ fassert(16205, U.n == 0);
W.n = 0;
R.n = 1;
notifyWeUnlocked('W');
@@ -248,9 +248,9 @@ namespace mongo {
// YOU MAY DEADLOCK WITH THREADS LEAVING THE X STATE.
inline void QLock::R_to_W() {
boost::mutex::scoped_lock lk(m);
- fassert(0, R.n > 0);
- fassert(0, W.n == 0);
- fassert(0, U.n == 0);
+ fassert(16206, R.n > 0);
+ fassert(16207, W.n == 0);
+ fassert(16208, U.n == 0);
U.n = 1;
@@ -265,9 +265,9 @@ namespace mongo {
if (!wereGlobalWritesGreedy)
_stop_greed();
- fassert(0, R.n == 1);
- fassert(0, W.n == 0);
- fassert(0, U.n == 1);
+ fassert(16209, R.n == 1);
+ fassert(16210, W.n == 0);
+ fassert(16211, U.n == 1);
R.n = 0;
W.n = 1;
@@ -277,8 +277,8 @@ namespace mongo {
inline bool QLock::w_to_X() {
boost::mutex::scoped_lock lk(m);
- fassert( 0, w.n > 0 );
- fassert( 0, areGlobalWritesGreedy );
+ fassert( 16212, w.n > 0 );
+ fassert( 16213, areGlobalWritesGreedy );
++X.n;
--w.n;
@@ -289,8 +289,8 @@ namespace mongo {
X.c.wait(m);
if ( myGeneration == generationX ) {
- fassert( 0, X_legal() );
- fassert( 0, w.n == 0 );
+ fassert( 16214, X_legal() );
+ fassert( 16215, w.n == 0 );
++generationX;
notifyWeUnlocked('w');
return true;
@@ -299,19 +299,19 @@ namespace mongo {
while ( myGeneration == generationXExit )
X.c.wait(m);
- fassert( 0, R.n == 0 );
- fassert( 0, w.n > 0 );
- fassert( 0, areGlobalWritesGreedy );
+ fassert( 16216, R.n == 0 );
+ fassert( 16217, w.n > 0 );
+ fassert( 16218, areGlobalWritesGreedy );
return false;
}
inline void QLock::X_to_w() {
boost::mutex::scoped_lock lk(m);
- fassert( 0, W.n == 0 );
- fassert( 0, R.n == 0 );
- fassert( 0, w.n == 0 );
- fassert( 0, X.n > 0 );
+ fassert( 16219, W.n == 0 );
+ fassert( 16220, R.n == 0 );
+ fassert( 16221, w.n == 0 );
+ fassert( 16222, X.n > 0 );
w.n = X.n;
X.n = 0;
Please sign in to comment.
Something went wrong with that request. Please try again.