diff options
author | maximius <none@none> | 2009-10-17 15:51:44 -0700 |
---|---|---|
committer | maximius <none@none> | 2009-10-17 15:51:44 -0700 |
commit | e585187b248f48b3c6e9247b49fa07c6565d65e5 (patch) | |
tree | 637c5b7ddacf41040bef4ea4f75a97da64c6a9bc /dep/ACE_wrappers/ace/Thread.cpp | |
parent | 26b5e033ffde3d161382fc9addbfa99738379641 (diff) |
*Backed out changeset 3be01fb200a5
--HG--
branch : trunk
Diffstat (limited to 'dep/ACE_wrappers/ace/Thread.cpp')
-rw-r--r-- | dep/ACE_wrappers/ace/Thread.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/dep/ACE_wrappers/ace/Thread.cpp b/dep/ACE_wrappers/ace/Thread.cpp index 29bd6d59584..1b4edd48825 100644 --- a/dep/ACE_wrappers/ace/Thread.cpp +++ b/dep/ACE_wrappers/ace/Thread.cpp @@ -1,13 +1,19 @@ // $Id: Thread.cpp 80826 2008-03-04 14:51:23Z wotte $ + #include "ace/Thread.h" + ACE_RCSID(ace, Thread, "$Id: Thread.cpp 80826 2008-03-04 14:51:23Z wotte $") + #if !defined (__ACE_INLINE__) #include "ace/Thread.inl" #endif /* !defined (__ACE_INLINE__) */ + #if defined (ACE_HAS_THREADS) + ACE_BEGIN_VERSIONED_NAMESPACE_DECL + size_t ACE_Thread::spawn_n (size_t n, ACE_THR_FUNC func, @@ -22,6 +28,7 @@ ACE_Thread::spawn_n (size_t n, ACE_TRACE ("ACE_Thread::spawn_n"); ACE_thread_t t_id; size_t i; + for (i = 0; i < n; i++) // Bail out if error occurs. if (ACE_OS::thr_create (func, @@ -35,8 +42,10 @@ ACE_Thread::spawn_n (size_t n, thread_adapter, thr_name == 0 ? 0 : &thr_name[i]) != 0) break; + return i; } + size_t ACE_Thread::spawn_n (ACE_thread_t thread_ids[], size_t n, @@ -52,10 +61,12 @@ ACE_Thread::spawn_n (ACE_thread_t thread_ids[], { ACE_TRACE ("ACE_Thread::spawn_n"); size_t i = 0; + for (i = 0; i < n; i++) { ACE_thread_t t_id; ACE_hthread_t t_handle; + int const result = ACE_OS::thr_create (func, arg, @@ -67,6 +78,7 @@ ACE_Thread::spawn_n (ACE_thread_t thread_ids[], stack_size == 0 ? ACE_DEFAULT_THREAD_STACKSIZE : stack_size[i], thread_adapter, thr_name == 0 ? 0 : &thr_name[i]); + if (result == 0) { if (thread_ids != 0) @@ -78,8 +90,11 @@ ACE_Thread::spawn_n (ACE_thread_t thread_ids[], // Bail out if error occurs. break; } + return i; } + ACE_END_VERSIONED_NAMESPACE_DECL + #endif /* ACE_HAS_THREADS */ |