diff options
-rw-r--r-- | ace/Thread_Manager.cpp | 2 | ||||
-rw-r--r-- | ace/Thread_Manager.h | 21 | ||||
-rw-r--r-- | tests/Barrier_Test.cpp | 6 |
3 files changed, 15 insertions, 14 deletions
diff --git a/ace/Thread_Manager.cpp b/ace/Thread_Manager.cpp index 0f312fa01e1..ee86fe81903 100644 --- a/ace/Thread_Manager.cpp +++ b/ace/Thread_Manager.cpp @@ -363,7 +363,7 @@ ACE_Thread_Manager::spawn_n (ACE_thread_t thread_ids[], if (this->spawn_i (func, args, flags, - &thread_ids[i], + thread_ids == 0 ? 0 : &thread_ids[i], thread_handles == 0 ? 0 : &thread_handles[i], priority, grp_id, diff --git a/ace/Thread_Manager.h b/ace/Thread_Manager.h index 80792193461..37d8f01ef98 100644 --- a/ace/Thread_Manager.h +++ b/ace/Thread_Manager.h @@ -140,16 +140,17 @@ public: size_t stack_size[] = 0, ACE_hthread_t thread_handles[] = 0); // Spawn N new threads, which execute <func> with argument <arg>. - // The thread_ids of successfully spawned threads will be placed - // into the <thread_ids> buffer (which must be the same size as - // <n>). If <stack> != 0 it is assumed to be an array of <n> - // pointers to the base of the stacks to use for the threads being - // spawned. If <stack_size> != 0 it is assumed to be an array of - // <n> values indicating how big each of the corresponding <stack>s - // are. If <thread_handles> != 0 it is assumed to be an array of - // <n> thread_handles that will be assigned the values of the thread - // handles being spawned. Returns -1 on failure (<errno> will - // explain...), otherwise returns the group id of the threads. + // If <thread_ids> != 0 the thread_ids of successfully spawned + // threads will be placed into the <thread_ids> buffer (which must + // be the same size as <n>). If <stack> != 0 it is assumed to be an + // array of <n> pointers to the base of the stacks to use for the + // threads being spawned. If <stack_size> != 0 it is assumed to be + // an array of <n> values indicating how big each of the + // corresponding <stack>s are. If <thread_handles> != 0 it is + // assumed to be an array of <n> thread_handles that will be + // assigned the values of the thread handles being spawned. Returns + // -1 on failure (<errno> will explain...), otherwise returns the + // group id of the threads. void *exit (void *status, int do_thread_exit = 1); // Called to clean up when a thread exits. If <do_thread_exit> is diff --git a/tests/Barrier_Test.cpp b/tests/Barrier_Test.cpp index 50fc1502057..0aa3d4d6c53 100644 --- a/tests/Barrier_Test.cpp +++ b/tests/Barrier_Test.cpp @@ -80,18 +80,18 @@ main (int, char *[]) Tester_Args args (tester_barrier, n_iterations); for (int iteration_count = 0; - iteration_count < 10; + iteration_count < ACE_MAX_ITERATIONS; iteration_count++) { ACE_DEBUG ((LM_DEBUG, "starting iteration %d\n", iteration_count)); if (ACE_Thread_Manager::instance ()->spawn_n - (0, + ((ACE_thread_t *) 0, n_threads, ACE_THR_FUNC (tester), (void *) &args, - THR_NEW_LWP | THR_DETACHED, + THR_NEW_LWP, ACE_DEFAULT_THREAD_PRIORITY, -1, 0, |