From 42c74b2cf7edcbd5efc7fb5051fb53cd5baa3ce2 Mon Sep 17 00:00:00 2001 From: Brian Barrett Date: Tue, 5 Jun 2007 19:24:17 +0000 Subject: [PATCH] fix test case so that condition variables work right, at least on PTHREADS. I'm pretty sure condition variables are wrong for Solaris threads. This commit was SVN r14877. --- test/threads/opal_condition.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/threads/opal_condition.c b/test/threads/opal_condition.c index a6b99894f9..6ef8fa7622 100644 --- a/test/threads/opal_condition.c +++ b/test/threads/opal_condition.c @@ -4,6 +4,7 @@ #include #include "support.h" +#include "opal/runtime/opal.h" #include "opal/constants.h" #include "opal/threads/threads.h" #include "opal/threads/condition.h" @@ -33,7 +34,7 @@ static volatile int thr1_count = 0; static volatile int thr2_count = 0; -#define TEST_COUNT 1000000 +#define TEST_COUNT 100000 static void* thr1_run(opal_object_t* obj) @@ -79,6 +80,9 @@ int main(int argc, char** argv) test_init("opal_condition_t"); + opal_init(); + opal_set_using_threads(true); + OBJ_CONSTRUCT(&mutex, opal_mutex_t); OBJ_CONSTRUCT(&thr1_cond, opal_condition_t); OBJ_CONSTRUCT(&thr2_cond, opal_condition_t); @@ -102,6 +106,8 @@ int main(int argc, char** argv) test_verify_int(OPAL_SUCCESS, rc); test_verify_int(TEST_COUNT, thr2_count); + opal_finalize(); + return test_finalize(); }