Commit 084e4240 authored by Pavel Vainerman's avatar Pavel Vainerman

test correct

parent 78109f59
#include <string> #include <string>
#include <sstream>
#include "Mutex.h" #include "Mutex.h"
#include "ThreadCreator.h" #include "ThreadCreator.h"
#include "UniSetTypes.h" #include "UniSetTypes.h"
...@@ -35,10 +36,11 @@ class MyClass ...@@ -35,10 +36,11 @@ class MyClass
{ {
{ {
cerr << nm << ": before release=" << m.isRelease() << endl; cerr << nm << ": before release=" << m.isRelease() << endl;
uniset_mutex_lock l(m,5000); uniset_mutex_lock l(m);
msleep(30);
cerr << nm << ": after release=" << m.isRelease() << endl; cerr << nm << ": after release=" << m.isRelease() << endl;
} }
msleep(300); msleep(10);
} }
} }
...@@ -49,14 +51,20 @@ class MyClass ...@@ -49,14 +51,20 @@ class MyClass
int main( int argc, const char **argv ) int main( int argc, const char **argv )
{ {
MyClass* mc1 = new MyClass("t1"); int max = 10;
MyClass* mc2 = new MyClass("t2");
// m.lock(); if( argc > 1 )
mc1->execute(); max = UniSetTypes::uni_atoi(argv[1]);
msleep(200);
mc2->execute(); for( int i=0; i<max; i++ )
{
ostringstream s;
s << "t" << i;
MyClass* t = new MyClass(s.str());
t->execute();
msleep(50);
}
pause(); pause();
// m.unlock();
return 0; return 0;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment