summaryrefslogtreecommitdiff
path: root/examples/IPC_SAP/UPIPE_SAP/ex3.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/IPC_SAP/UPIPE_SAP/ex3.cpp')
-rw-r--r--examples/IPC_SAP/UPIPE_SAP/ex3.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/examples/IPC_SAP/UPIPE_SAP/ex3.cpp b/examples/IPC_SAP/UPIPE_SAP/ex3.cpp
index 7492d218d61..eb0a63b1f69 100644
--- a/examples/IPC_SAP/UPIPE_SAP/ex3.cpp
+++ b/examples/IPC_SAP/UPIPE_SAP/ex3.cpp
@@ -27,9 +27,6 @@ ACE_RCSID(UPIPE_SAP, ex3, "$Id$")
#if defined (ACE_HAS_THREADS)
-// Global thread manager.
-static ACE_Thread_Manager thr_mgr;
-
// Data for testsuite.
static int size = 0;
static int iterations = 0;
@@ -84,8 +81,9 @@ consumer (void *)
"(%t) consumer spawning the supplier thread\n"));
// Spawn the supplier thread.
- if (thr_mgr.spawn (ACE_THR_FUNC (supplier), (void *) 0,
- THR_NEW_LWP | THR_DETACHED) == -1)
+ if (ACE_Thread_Manager::instance ()->spawn (ACE_THR_FUNC (supplier),
+ (void *) 0,
+ THR_NEW_LWP | THR_DETACHED) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
"%p\n",
"spawn"),
@@ -138,14 +136,15 @@ main (int argc, char *argv[])
iterations = argc > 2 ? ACE_OS::atoi (argv[2]) : 16;
// Spawn the thread.
- if (thr_mgr.spawn (ACE_THR_FUNC (consumer), (void *) 0,
- THR_NEW_LWP | THR_DETACHED) == -1)
+ if (ACE_Thread_Manager::instance ()->spawn (ACE_THR_FUNC (consumer),
+ (void *) 0,
+ THR_NEW_LWP | THR_DETACHED) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
"%p\n",
"spawn"),
1);
// Wait for producer and consumer threads to exit.
- thr_mgr.wait ();
+ ACE_Thread_Manager::instance ()->wait ();
return 0;
}
#else