More thread tool regression test scheduler sensitivity fixes

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11923
This commit is contained in:
Bart Van Assche
2011-07-27 08:49:12 +00:00
parent 6bf91676f8
commit f7c4be8a6a
5 changed files with 14 additions and 7 deletions

View File

@@ -305,6 +305,7 @@ static void* thread_func(void* arg)
int main(int argc, char** argv)
{
struct timespec delay = { 0, 100 * 1000 * 1000 };
const int nthreads = std::max(argc > 1 ? atoi(argv[1]) : 1, 1);
const int iterations = std::max(argc > 2 ? atoi(argv[2]) : 1, 1);
s_enable_annotations = argc > 3 ? !!atoi(argv[3]) : true;
@@ -318,6 +319,7 @@ int main(int argc, char** argv)
for (int i = 0; i < nthreads; ++i)
T[i].Create(thread_func, new smart_ptr<counter>(p));
p = NULL;
nanosleep(&delay, 0);
for (int i = 0; i < nthreads; ++i)
T[i].Join();
}