1 #include "ace/Thread.h"
3 #if !defined (__ACE_INLINE__)
4 #include "ace/Thread.inl"
5 #endif /* !defined (__ACE_INLINE__) */
7 #if defined (ACE_HAS_THREADS)
9 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
12 ACE_Thread::spawn_n (size_t n
,
19 ACE_Thread_Adapter
*thread_adapter
,
20 const char* thr_name
[])
22 ACE_TRACE ("ACE_Thread::spawn_n");
25 for (i
= 0; i
< n
; i
++)
28 // Bail out if error occurs.
29 if (ACE_OS::thr_create (func
,
35 stack
== 0 ? 0 : stack
[i
],
36 stack_size
== 0 ? ACE_DEFAULT_THREAD_STACKSIZE
: stack_size
[i
],
38 thr_name
== 0 ? 0 : &thr_name
[i
]) != 0)
46 ACE_Thread::spawn_n (ACE_thread_t thread_ids
[],
54 ACE_hthread_t thread_handles
[],
55 ACE_Thread_Adapter
*thread_adapter
,
56 const char* thr_name
[])
58 ACE_TRACE ("ACE_Thread::spawn_n");
61 for (i
= 0; i
< n
; i
++)
64 ACE_hthread_t t_handle
;
67 ACE_OS::thr_create (func
,
73 stack
== 0 ? 0 : stack
[i
],
74 stack_size
== 0 ? ACE_DEFAULT_THREAD_STACKSIZE
: stack_size
[i
],
76 thr_name
== 0 ? 0 : &thr_name
[i
]);
82 if (thread_handles
!= 0)
83 thread_handles
[i
] = t_handle
;
86 // Bail out if error occurs.
93 ACE_END_VERSIONED_NAMESPACE_DECL
95 #endif /* ACE_HAS_THREADS */