summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1997-08-30 19:32:42 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1997-08-30 19:32:42 +0000
commit6a4d079a1330b91c50af8909ddd673f65e667fec (patch)
treea5f7df2c92c6559d1d97ae740e6ec283553fceaa /tests
parent318ea665ab5316e3d40ba4a6aca7715f174ff072 (diff)
downloadATCD-6a4d079a1330b91c50af8909ddd673f65e667fec.tar.gz
*** empty log message ***
Diffstat (limited to 'tests')
-rw-r--r--tests/Barrier_Test.cpp4
-rw-r--r--tests/Conn_Test.cpp4
-rw-r--r--tests/IOStream_Test.cpp6
-rw-r--r--tests/MM_Shared_Memory_Test.cpp21
-rw-r--r--tests/Mutex_Test.cpp1
-rw-r--r--tests/Priority_Buffer_Test.cpp4
-rw-r--r--tests/Priority_Task_Test.cpp14
-rw-r--r--tests/Process_Strategy_Test.cpp4
-rw-r--r--tests/Reactor_Exceptions_Test.cpp1
-rw-r--r--tests/Reactors_Test.cpp2
-rw-r--r--tests/Reader_Writer_Test.cpp2
-rw-r--r--tests/Recursive_Mutex_Test.cpp1
-rw-r--r--tests/SOCK_Test.cpp4
-rw-r--r--tests/SPIPE_Test.cpp20
-rw-r--r--tests/Semaphore_Test.cpp1
-rw-r--r--tests/TSS_Test.cpp1
-rw-r--r--tests/Thread_Manager_Test.cpp21
-rw-r--r--tests/Tokens_Test.cpp1
18 files changed, 29 insertions, 83 deletions
diff --git a/tests/Barrier_Test.cpp b/tests/Barrier_Test.cpp
index 999434a7c5f..b34b262312d 100644
--- a/tests/Barrier_Test.cpp
+++ b/tests/Barrier_Test.cpp
@@ -48,10 +48,6 @@ tester (Tester_Args *args)
{
ACE_NEW_THREAD;
-#if defined (VXWORKS)
- ACE_Thread_Control tc (ACE_Thread_Manager::instance ());
-#endif /* VXWORKS */
-
for (int iterations = 1;
iterations <= args->n_iterations_;
iterations++)
diff --git a/tests/Conn_Test.cpp b/tests/Conn_Test.cpp
index 3f5f03d8ed7..6e7b4c5eee2 100644
--- a/tests/Conn_Test.cpp
+++ b/tests/Conn_Test.cpp
@@ -353,8 +353,6 @@ static void *
client (void *arg)
{
#if (defined (ACE_WIN32) || defined (VXWORKS)) && defined (ACE_HAS_THREADS)
- // Insert thread into thr_mgr
- ACE_Thread_Control thread_control (ACE_Thread_Manager::instance ());
ACE_NEW_THREAD;
#endif /* (defined (ACE_WIN32) || defined (VXWORKS)) && defined (ACE_HAS_THREADS) */
@@ -389,8 +387,6 @@ static void *
server (void *arg)
{
#if (defined (ACE_WIN32) || defined (VXWORKS)) && defined (ACE_HAS_THREADS)
- // Insert thread into thr_mgr
- ACE_Thread_Control thread_control (ACE_Thread_Manager::instance ());
ACE_NEW_THREAD;
#endif /* (defined (ACE_WIN32) || defined (VXWORKS)) && defined (ACE_HAS_THREADS) */
diff --git a/tests/IOStream_Test.cpp b/tests/IOStream_Test.cpp
index 73bea0ab44e..764643cf328 100644
--- a/tests/IOStream_Test.cpp
+++ b/tests/IOStream_Test.cpp
@@ -154,10 +154,6 @@ client (void *arg = 0)
ACE_NEW_THREAD;
ACE_UNUSED_ARG (arg);
-#if defined (ACE_HAS_THREADS)
- ACE_Thread_Control thread_control (ACE_Thread_Manager::instance ());
-#endif /* ACE_HAS_THREADS */
-
// We don't _need_ to dynamically allocate the ACE_SOCK_IOStream.
// But if we don't, it doesn't get destroyed on some platforms, e.g.,
// g++ 2.7.2.1 and Sun C++ 4.2 on Solaris 2.5.1. (It does work on
@@ -265,8 +261,6 @@ server (void *arg = 0)
ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "get_local_addr"), 0);
#if defined (ACE_HAS_THREADS)
- ACE_Thread_Control thread_control (ACE_Thread_Manager::instance ());
-
if (ACE_Thread_Manager::instance ()->spawn (ACE_THR_FUNC (client),
(void *) &server_addr,
THR_NEW_LWP | THR_DETACHED) == -1)
diff --git a/tests/MM_Shared_Memory_Test.cpp b/tests/MM_Shared_Memory_Test.cpp
index 6149e201fda..c7045bc28e9 100644
--- a/tests/MM_Shared_Memory_Test.cpp
+++ b/tests/MM_Shared_Memory_Test.cpp
@@ -29,15 +29,10 @@
const int SHMSZ = 27;
static TCHAR shm_key[] = ACE_TEMP_FILE_NAME __TEXT ("XXXXXX");
-// Global thread manager.
-static ACE_Thread_Manager thr_mgr;
-
static void *
client (void *)
{
#if defined (ACE_WIN32) || defined (VXWORKS)
- // Insert thread into thr_mgr
- ACE_Thread_Control thread_control (&thr_mgr);
ACE_NEW_THREAD;
#endif /* ACE_WIN32 */
@@ -62,8 +57,6 @@ static void *
server (void *)
{
#if defined (ACE_WIN32) || defined (VXWORKS)
- // Insert thread into thr_mgr
- ACE_Thread_Control thread_control (&thr_mgr);
ACE_NEW_THREAD;
#endif /* ACE_WIN32 */
@@ -103,16 +96,16 @@ spawn (void)
server (0);
}
#elif defined (ACE_HAS_THREADS)
- if (thr_mgr.spawn (ACE_THR_FUNC (client),
- (void *) 0,
- THR_NEW_LWP | THR_DETACHED) == -1)
+ if (ACE_Thread_Manager::instance ()->spawn (ACE_THR_FUNC (client),
+ (void *) 0,
+ THR_NEW_LWP | THR_DETACHED) == -1)
ACE_ERROR ((LM_ERROR, "%p\n%a", "thread create failed"));
- if (thr_mgr.spawn (ACE_THR_FUNC (server),
- (void *) 0,
- THR_NEW_LWP | THR_DETACHED) == -1)
+ if (ACE_Thread_Manager::instance ()->spawn (ACE_THR_FUNC (server),
+ (void *) 0,
+ THR_NEW_LWP | THR_DETACHED) == -1)
ACE_ERROR ((LM_ERROR, "%p\n%a", "thread create failed"));
- thr_mgr.wait ();
+ ACE_Thread_Manager::instance ()->wait ();
#else
ACE_ERROR ((LM_ERROR, "only one thread may be run in a process on this platform\n%a", 1));
#endif /* ACE_HAS_THREADS */
diff --git a/tests/Mutex_Test.cpp b/tests/Mutex_Test.cpp
index 3cb23cc978f..85694dc86b2 100644
--- a/tests/Mutex_Test.cpp
+++ b/tests/Mutex_Test.cpp
@@ -27,7 +27,6 @@ test (void *args)
{
ACE_Process_Mutex *pm = (ACE_Process_Mutex *) args;
#if (defined (ACE_WIN32) || defined (VXWORKS)) && defined (ACE_HAS_THREADS)
- ACE_Thread_Control tc (ACE_Thread_Manager::instance ());
ACE_NEW_THREAD;
#endif /* (defined (ACE_WIN32) || defined (VXWORKS)) && defined (ACE_HAS_THREADS) */
diff --git a/tests/Priority_Buffer_Test.cpp b/tests/Priority_Buffer_Test.cpp
index 50bf7cb1e2e..82afc79cc93 100644
--- a/tests/Priority_Buffer_Test.cpp
+++ b/tests/Priority_Buffer_Test.cpp
@@ -19,7 +19,6 @@
//
// ============================================================================
-
#include "ace/Message_Queue.h"
#include "ace/Service_Config.h"
#include "test_config.h"
@@ -89,7 +88,6 @@ producer (void *args)
ACE_Message_Queue<ACE_MT_SYNCH> *msg_queue = (ACE_Message_Queue<ACE_MT_SYNCH> *) args;
// Insert thread into thr_mgr.
- ACE_Thread_Control thread_control (ACE_Thread_Manager::instance ());
ACE_NEW_THREAD;
ACE_Message_Block *mb = 0;
@@ -124,8 +122,6 @@ producer (void *args)
// the size of the lines!).
consumer (msg_queue);
- // The destructor of ACE_Thread_Control removes the exiting thread
- // from the thr_mgr automatically.
return 0;
}
diff --git a/tests/Priority_Task_Test.cpp b/tests/Priority_Task_Test.cpp
index 5d8f9c7163f..f08f20c99b8 100644
--- a/tests/Priority_Task_Test.cpp
+++ b/tests/Priority_Task_Test.cpp
@@ -37,7 +37,7 @@ private:
};
Priority_Task::Priority_Task (void)
-: ACE_Task<ACE_MT_SYNCH> (ACE_Thread_Manager::instance ()),
+ : ACE_Task<ACE_MT_SYNCH> (ACE_Thread_Manager::instance ()),
priority_ (0)
{
}
@@ -55,10 +55,10 @@ Priority_Task::open (void *arg)
// Become an active object.
if (this->activate (flags, 1, 0, this->priority_) == -1)
{
- // On Linux, only the superuser can set the policy to other
- // than ACE_SCHED_OTHER. But with ACE_SCHED_OTHER, there is
- // only 1 thread priority value, 0. So, let the superuser
- // run an interesting test, but for other users use priority 0.
+ // On Linux, only the superuser can set the policy to other than
+ // ACE_SCHED_OTHER. But with ACE_SCHED_OTHER, there is only 1
+ // thread priority value, 0. So, let the superuser run an
+ // interesting test, but for other users use priority 0.
ACE_DEBUG ((LM_DEBUG, "(%t) task activation at priority %d with flags "
"%ld failed; retry at priority 0 with with flags "
@@ -69,9 +69,7 @@ Priority_Task::open (void *arg)
this->priority_ = 0;
if (this->activate (flags, 1, 1, this->priority_) == -1)
- {
- ACE_DEBUG ((LM_ERROR, "(%t) task activation at priority 0 failed, exiting!\n%a", -1));
- }
+ ACE_DEBUG ((LM_ERROR, "(%t) task activation at priority 0 failed, exiting!\n%a", -1));
}
return 0;
diff --git a/tests/Process_Strategy_Test.cpp b/tests/Process_Strategy_Test.cpp
index 611bc262763..7cae8fb9a7d 100644
--- a/tests/Process_Strategy_Test.cpp
+++ b/tests/Process_Strategy_Test.cpp
@@ -367,8 +367,6 @@ static void *
client (void *arg)
{
#if (defined (ACE_WIN32) || defined (VXWORKS)) && defined (ACE_HAS_THREADS)
- // Insert thread into thr_mgr
- ACE_Thread_Control thread_control (ACE_Thread_Manager::instance ());
ACE_NEW_THREAD;
#endif /* (defined (ACE_WIN32) || defined (VXWORKS)) && defined (ACE_HAS_THREADS) */
@@ -454,8 +452,6 @@ static void *
server (void *)
{
#if (defined (ACE_WIN32) || defined (VXWORKS)) && defined (ACE_HAS_THREADS)
- // Insert thread into thr_mgr
- ACE_Thread_Control thread_control (ACE_Thread_Manager::instance ());
ACE_NEW_THREAD;
#endif /* (defined (ACE_WIN32) || defined (VXWORKS)) && defined (ACE_HAS_THREADS) */
diff --git a/tests/Reactor_Exceptions_Test.cpp b/tests/Reactor_Exceptions_Test.cpp
index df7b50a7f4b..511b27158ba 100644
--- a/tests/Reactor_Exceptions_Test.cpp
+++ b/tests/Reactor_Exceptions_Test.cpp
@@ -95,7 +95,6 @@ static int
worker (void)
{
ACE_NEW_THREAD;
- ACE_Thread_Control tc (ACE_Thread_Manager::instance ());
ACE_Reactor::instance()->owner (ACE_OS::thr_self());
diff --git a/tests/Reactors_Test.cpp b/tests/Reactors_Test.cpp
index 047c1bef5e9..9a168ba22c2 100644
--- a/tests/Reactors_Test.cpp
+++ b/tests/Reactors_Test.cpp
@@ -145,8 +145,6 @@ worker (void *args)
{
ACE_NEW_THREAD;
- ACE_Thread_Control tc (ACE_Thread_Manager::instance ());
-
ACE_Reactor *reactor = (ACE_Reactor *) args;
// Make this thread the owner of the Reactor's event loop.
diff --git a/tests/Reader_Writer_Test.cpp b/tests/Reader_Writer_Test.cpp
index 27f346ba894..759cc664285 100644
--- a/tests/Reader_Writer_Test.cpp
+++ b/tests/Reader_Writer_Test.cpp
@@ -88,7 +88,6 @@ parse_args (int argc, char *argv[])
static void *
reader (void *)
{
- ACE_Thread_Control tc (ACE_Thread_Manager::instance ());
ACE_NEW_THREAD;
ACE_DEBUG ((LM_DEBUG, " (%t) reader starting\n"));
@@ -134,7 +133,6 @@ reader (void *)
static void *
writer (void *)
{
- ACE_Thread_Control tc (ACE_Thread_Manager::instance ());
ACE_NEW_THREAD;
ACE_DEBUG ((LM_DEBUG, " (%t) writer starting\n"));
diff --git a/tests/Recursive_Mutex_Test.cpp b/tests/Recursive_Mutex_Test.cpp
index 71647d8dc26..e7bbef19fbf 100644
--- a/tests/Recursive_Mutex_Test.cpp
+++ b/tests/Recursive_Mutex_Test.cpp
@@ -53,7 +53,6 @@ recursive_worker (size_t nesting_level,
static void *
worker (void *arg)
{
- ACE_Thread_Control tc (ACE_Thread_Manager::instance ());
ACE_NEW_THREAD;
ACE_Recursive_Thread_Mutex *rm = (ACE_Recursive_Thread_Mutex *) arg;
diff --git a/tests/SOCK_Test.cpp b/tests/SOCK_Test.cpp
index 37e143fc0d3..89bffc10db0 100644
--- a/tests/SOCK_Test.cpp
+++ b/tests/SOCK_Test.cpp
@@ -32,8 +32,6 @@ static void *
client (void *arg)
{
#if (defined (ACE_WIN32) || defined (VXWORKS)) && defined (ACE_HAS_THREADS)
- // Insert thread into thr_mgr
- ACE_Thread_Control thread_control (ACE_Thread_Manager::instance ());
ACE_NEW_THREAD;
#endif /* (defined (ACE_WIN32) || defined (VXWORKS)) && defined (ACE_HAS_THREADS) */
@@ -96,8 +94,6 @@ static void *
server (void *arg)
{
#if (defined (ACE_WIN32) || defined (VXWORKS)) && defined (ACE_HAS_THREADS)
- // Insert thread into thr_mgr
- ACE_Thread_Control thread_control (ACE_Thread_Manager::instance ());
ACE_NEW_THREAD;
#endif /* (defined (ACE_WIN32) || defined (VXWORKS)) && defined (ACE_HAS_THREADS) */
diff --git a/tests/SPIPE_Test.cpp b/tests/SPIPE_Test.cpp
index f3896a2d6c7..57d48e9e3b8 100644
--- a/tests/SPIPE_Test.cpp
+++ b/tests/SPIPE_Test.cpp
@@ -32,14 +32,10 @@
// pipe name to use
static const char *PIPE_NAME = "ace_pipe_name";
-// Global thread manager.
-static ACE_Thread_Manager thr_mgr;
-
static void *
client (void *)
{
#if defined (ACE_WIN32)
- ACE_Thread_Control thread_control (&thr_mgr); // Insert thread into thr_mgr
ACE_NEW_THREAD;
#endif
const char *rendezvous = PIPE_NAME;
@@ -68,7 +64,6 @@ static void *
server (void *)
{
#if defined (ACE_WIN32)
- ACE_Thread_Control thread_control (&thr_mgr); // Insert thread into thr_mgr
ACE_NEW_THREAD;
#endif
ACE_SPIPE_Acceptor acceptor;
@@ -118,16 +113,17 @@ main (int, char *[])
server (0);
}
#elif defined (ACE_HAS_THREADS)
- if (thr_mgr.spawn (ACE_THR_FUNC (client),
- (void *) 0,
- THR_NEW_LWP | THR_DETACHED) == -1)
+ if (ACE_Thread_Manager::instance ()->spawn (ACE_THR_FUNC (client),
+ (void *) 0,
+ THR_NEW_LWP | THR_DETACHED) == -1)
ACE_ERROR ((LM_ERROR, "%p\n%a", "thread create failed"));
- if (thr_mgr.spawn (ACE_THR_FUNC (server),
- (void *) 0,
- THR_NEW_LWP | THR_DETACHED) == -1)
+ if (ACE_Thread_Manager::instance ()->spawn (ACE_THR_FUNC (server),
+ (void *) 0,
+ THR_NEW_LWP | THR_DETACHED) == -1)
ACE_ERROR ((LM_ERROR, "%p\n%a", "thread create failed"));
- thr_mgr.wait ();
+
+ ACE_Thread_Manager::instance ()->wait ();
#else
ACE_DEBUG ((LM_DEBUG,
"SPIPE is not supported on this platform\n"));
diff --git a/tests/Semaphore_Test.cpp b/tests/Semaphore_Test.cpp
index 17587346191..26433d1bdb0 100644
--- a/tests/Semaphore_Test.cpp
+++ b/tests/Semaphore_Test.cpp
@@ -106,7 +106,6 @@ test_timeout (void)
static void *
worker (void *)
{
- ACE_Thread_Control tc (ACE_Thread_Manager::instance ());
ACE_NEW_THREAD;
for (size_t iterations = 1;
diff --git a/tests/TSS_Test.cpp b/tests/TSS_Test.cpp
index 09a765e0d32..dbe669af692 100644
--- a/tests/TSS_Test.cpp
+++ b/tests/TSS_Test.cpp
@@ -61,7 +61,6 @@ cleanup (void *ptr)
static void *
worker (void *c)
{
- ACE_Thread_Control tc (ACE_Thread_Manager::instance ());
ACE_NEW_THREAD;
int count = int (c);
diff --git a/tests/Thread_Manager_Test.cpp b/tests/Thread_Manager_Test.cpp
index 58211f14039..8ed63df05a5 100644
--- a/tests/Thread_Manager_Test.cpp
+++ b/tests/Thread_Manager_Test.cpp
@@ -35,22 +35,17 @@ handler (int signum)
static void *
worker (int iterations)
{
- ACE_Thread_Control tc (ACE_Thread_Manager::instance ());
ACE_NEW_THREAD;
for (int i = 0; i < iterations; i++)
- {
- if ((i % 1000) == 0)
- {
- if (ACE_Thread_Manager::instance ()->testcancel (ACE_Thread::self ()) != 0)
- {
- ACE_DEBUG ((LM_DEBUG,
- "(%t) has been cancelled before iteration %d!\n",
- i));
- break;
- }
- }
- }
+ if ((i % 1000) == 0
+ && ACE_Thread_Manager::instance ()->testcancel (ACE_Thread::self ()) != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%t) has been cancelled before iteration %d!\n",
+ i));
+ break;
+ }
// Destructor removes thread from Thread_Manager.
return 0;
diff --git a/tests/Tokens_Test.cpp b/tests/Tokens_Test.cpp
index 691be54a620..93b3d6cf13e 100644
--- a/tests/Tokens_Test.cpp
+++ b/tests/Tokens_Test.cpp
@@ -55,7 +55,6 @@ public:
static void *
run_thread (void *vp)
{
- ACE_Thread_Control tc (ACE_Thread_Manager::instance ());
ACE_NEW_THREAD;
Test_Params *tp = (Test_Params *) vp;
ACE_Token_Collection collection (1, tp->collection_name_);