test tweaking

This commit is contained in:
dwight
2011-07-09 21:57:58 -04:00
parent 18a3dfff06
commit 757b692b0e

View File

@@ -473,46 +473,42 @@ namespace ThreadedTests {
virtual void subthread(int x) {
Client::initThread("utest");
switch( x ) {
case 1:
const char *what = " RURWR";
sleepmillis(100*x);
log() << x << " " << what[x] << endl;
switch( what[x] ) {
case 'W':
{
sleepsecs(3);
log() << x << " W want" << endl;
m.lock();
log() << x << " W got" << endl;
sleepsecs(1);
sleepmillis(100);
log() << x << " W unlock" << endl;
m.unlock();
}
break;
case 2:
case 'U':
{
log() << x << " U want" << endl;
m.lockAsUpgradable();
log() << x << " U got\n" << endl;
sleepsecs(8);
sleepsecs(1);
cout << endl;
log() << x << " U unlock\n" << endl;
m.unlockFromUpgradable();
}
break;
case 4:
case 'R':
{
sleepsecs(2);
}
case 3:
{
sleepsecs(2);
log() << x << " R want " << endl;
m.lock_shared();
log() << x << " R got " << endl;
sleepsecs(1);
sleepmillis(100);
log() << x << " R unlock" << endl;
m.unlock_shared();
}
break;
default:
log() << "default " << x << endl;
log() << "default? " << x << endl;
}
cc().shutdown();
@@ -524,7 +520,7 @@ namespace ThreadedTests {
All() : Suite( "threading" ) { }
void setupTests() {
//add< UpgradableTest >();
add< UpgradableTest >();
add< List1Test >();
add< List1Test2 >();