1 // $Id: Thread.cpp 80826 2008-03-04 14:51:23Z wotte $
3 #include "ace/Thread.h"
7 "$Id: Thread.cpp 80826 2008-03-04 14:51:23Z wotte $")
9 #if !defined (__ACE_INLINE__)
10 #include "ace/Thread.inl"
11 #endif /* !defined (__ACE_INLINE__) */
13 #if defined (ACE_HAS_THREADS)
15 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
18 ACE_Thread::spawn_n (size_t n
,
25 ACE_Thread_Adapter
*thread_adapter
,
26 const char* thr_name
[])
28 ACE_TRACE ("ACE_Thread::spawn_n");
32 for (i
= 0; i
< n
; i
++)
33 // Bail out if error occurs.
34 if (ACE_OS::thr_create (func
,
40 stack
== 0 ? 0 : stack
[i
],
41 stack_size
== 0 ? ACE_DEFAULT_THREAD_STACKSIZE
: stack_size
[i
],
43 thr_name
== 0 ? 0 : &thr_name
[i
]) != 0)
50 ACE_Thread::spawn_n (ACE_thread_t thread_ids
[],
58 ACE_hthread_t thread_handles
[],
59 ACE_Thread_Adapter
*thread_adapter
,
60 const char* thr_name
[])
62 ACE_TRACE ("ACE_Thread::spawn_n");
65 for (i
= 0; i
< n
; i
++)
68 ACE_hthread_t t_handle
;
71 ACE_OS::thr_create (func
,
77 stack
== 0 ? 0 : stack
[i
],
78 stack_size
== 0 ? ACE_DEFAULT_THREAD_STACKSIZE
: stack_size
[i
],
80 thr_name
== 0 ? 0 : &thr_name
[i
]);
86 if (thread_handles
!= 0)
87 thread_handles
[i
] = t_handle
;
90 // Bail out if error occurs.
97 ACE_END_VERSIONED_NAMESPACE_DECL
99 #endif /* ACE_HAS_THREADS */