diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1997-08-30 19:32:42 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1997-08-30 19:32:42 +0000 |
commit | 6a4d079a1330b91c50af8909ddd673f65e667fec (patch) | |
tree | a5f7df2c92c6559d1d97ae740e6ec283553fceaa /ace | |
parent | 318ea665ab5316e3d40ba4a6aca7715f174ff072 (diff) | |
download | ATCD-6a4d079a1330b91c50af8909ddd673f65e667fec.tar.gz |
*** empty log message ***
Diffstat (limited to 'ace')
-rw-r--r-- | ace/Containers.cpp | 3 | ||||
-rw-r--r-- | ace/Handle_Set.cpp | 2 | ||||
-rw-r--r-- | ace/OS.i | 41 | ||||
-rw-r--r-- | ace/Thread_Manager.cpp | 13 |
4 files changed, 30 insertions, 29 deletions
diff --git a/ace/Containers.cpp b/ace/Containers.cpp index 73f04908d68..040a6c53b87 100644 --- a/ace/Containers.cpp +++ b/ace/Containers.cpp @@ -410,7 +410,8 @@ ACE_Unbounded_Queue<T>::delete_nodes (void) ACE_Node<T> *temp = curr; curr = curr->next_; - ACE_DES_FREE_TEMPLATE (temp, this->allocator_->free, + ACE_DES_FREE_TEMPLATE (temp, + this->allocator_->free, ACE_Node, <T>); this->cur_size_--; } diff --git a/ace/Handle_Set.cpp b/ace/Handle_Set.cpp index 28858db233f..ce5ce1af3fa 100644 --- a/ace/Handle_Set.cpp +++ b/ace/Handle_Set.cpp @@ -89,7 +89,7 @@ ACE_Handle_Set::count_bits (u_long n) const ACE_TRACE ("ACE_Handle_Set::count_bits"); int rval = 0; - for (int i = 0; i < sizeof (u_long); i++) + for (int i = 0; n != 0; i++) { rval += ACE_Handle_Set::nbits_[n & 0xff]; n >>= 8; @@ -1658,13 +1658,12 @@ ACE_OS::thread_mutex_unlock (ACE_thread_mutex_t *m) #endif /* ACE_HAS_THREADS */ } -#if ! defined (ACE_WIN32) && ! defined (VXWORKS) -// +#if !defined (ACE_LACKS_COND_T) // NOTE: The ACE_OS::cond_* functions for Unix platforms are defined -// here because the ACE_OS::sema_* functions below need them. -// However, ACE_WIN32 and VXWORKS define the ACE_OS::cond_* functions -// using the ACE_OS::sema_* functions. So, they appear after -// the ACE_OS::sema_* functions. +// here because the ACE_OS::sema_* functions below need them. +// However, ACE_WIN32 and VXWORKS define the ACE_OS::cond_* functions +// using the ACE_OS::sema_* functions. So, they appear after the +// ACE_OS::sema_* functions. ACE_INLINE int ACE_OS::cond_destroy (ACE_cond_t *cv) { @@ -1856,7 +1855,7 @@ ACE_OS::cond_timedwait (ACE_cond_t *cv, ACE_NOTSUP_RETURN (-1); #endif /* ACE_HAS_THREADS */ } -#endif /* ! ACE_WIN32 && ! VXWORKS */ +#endif /* !ACE_LACKS_COND_T */ ACE_INLINE int ACE_OS::sema_destroy (ACE_sema_t *s) @@ -2237,13 +2236,13 @@ ACE_OS::sema_wait (ACE_sema_t *s, ACE_Time_Value &tv) #endif /* ACE_HAS_POSIX_SEM */ } -#if defined (ACE_WIN32) || defined (VXWORKS) -// -// NOTE: The ACE_OS::cond_* functions for some non-Unix platforms are defined -// here because they need the ACE_OS::sema_* functions above. -// However, some Unix platforms define the ACE_OS::sema_* functions -// using the ACE_OS::cond_* functions. So, they appear before -// the ACE_OS::sema_* functions above. +#if defined (ACE_LACKS_COND_T) + +// NOTE: The ACE_OS::cond_* functions for some non-Unix platforms are +// defined here because they need the ACE_OS::sema_* functions above. +// However, some Unix platforms define the ACE_OS::sema_* functions +// using the ACE_OS::cond_* functions. So, they appear before the +// ACE_OS::sema_* functions above. ACE_INLINE int ACE_OS::cond_destroy (ACE_cond_t *cv) { @@ -2447,10 +2446,10 @@ ACE_OS::cond_timedwait (ACE_cond_t *cv, { // ACE_TRACE ("ACE_OS::cond_timedwait"); #if defined (ACE_HAS_THREADS) -#if defined (ACE_HAS_WTHREADS) // Handle the easy case first. if (timeout == 0) return ACE_OS::cond_wait (cv, external_mutex); +#if defined (ACE_HAS_WTHREADS) // It's ok to increment this because the <external_mutex> must be // locked by the caller. @@ -2550,10 +2549,8 @@ ACE_OS::cond_timedwait (ACE_cond_t *cv, // POSIX semaphores don't have a timed wait. Should implement conds // with VxWorks semaphores instead, they do have a timed wait. But // all of the other cond operations would have to be modified. - ACE_UNUSED_ARG (cv); - ACE_UNUSED_ARG (external_mutex); - ACE_UNUSED_ARG (timeout); - ACE_NOTSUP_RETURN (-1); + else + return ACE_NOTSUP_RETURN (-1); #endif /* ACE_HAS_WTHREADS */ #else ACE_UNUSED_ARG (cv); @@ -2571,7 +2568,6 @@ ACE_OS::cond_timedwait (ACE_cond_t *cv, { // ACE_TRACE ("ACE_OS::cond_timedwait"); #if defined (ACE_HAS_THREADS) -#if defined (ACE_HAS_WTHREADS) // Handle the easy case first. if (timeout == 0) return ACE_OS::cond_wait (cv, external_mutex); @@ -2640,7 +2636,6 @@ ACE_OS::cond_timedwait (ACE_cond_t *cv, ACE_OS::thread_mutex_lock (external_mutex); errno = error; return result; -#endif /* ACE_HAS_WTHREADS */ #else ACE_NOTSUP_RETURN (-1); #endif /* ACE_HAS_THREADS */ @@ -2652,7 +2647,6 @@ ACE_OS::cond_wait (ACE_cond_t *cv, { // ACE_TRACE ("ACE_OS::cond_wait"); #if defined (ACE_HAS_THREADS) -#if defined (ACE_HAS_WTHREADS) // It's ok to increment this because the <external_mutex> must be // locked by the caller. cv->waiters_++; @@ -2702,13 +2696,12 @@ ACE_OS::cond_wait (ACE_cond_t *cv, // Reset errno in case mutex_lock() also fails... errno = error; return result; -#endif /* ACE_HAS_WTHREADS */ #else ACE_NOTSUP_RETURN (-1); #endif /* ACE_HAS_THREADS */ } #endif /* ACE_HAS_WTHREADS */ -#endif /* ACE_WIN32 || VXWORKS */ +#endif /* ACE_LACKS_COND_T */ ACE_INLINE int ACE_OS::rw_rdlock (ACE_rwlock_t *rw) diff --git a/ace/Thread_Manager.cpp b/ace/Thread_Manager.cpp index 198cbd80f92..9104d0ad7e4 100644 --- a/ace/Thread_Manager.cpp +++ b/ace/Thread_Manager.cpp @@ -271,7 +271,12 @@ ACE_Thread_Manager::spawn_i (ACE_THR_FUNC func, { ACE_Thread_Adapter *thread_args = 0; #if !defined (ACE_NO_THREAD_ADAPTER) - ACE_NEW_RETURN (thread_args, ACE_Thread_Adapter (func, args, (ACE_THR_C_FUNC) ace_thread_manager_adapter), -1); + ACE_NEW_RETURN (thread_args, + ACE_Thread_Adapter (func, + args, + (ACE_THR_C_FUNC) ace_thread_manager_adapter, + this), + -1); #endif /* ACE_NO_THREAD_ADAPTER */ ACE_TRACE ("ACE_Thread_Manager::spawn_i"); @@ -941,7 +946,9 @@ ACE_Thread_Manager::wait_task (ACE_Task_Base *task) { ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - copy_table = new ACE_Thread_Descriptor [this->current_count_]; + ACE_NEW_RETURN (copy_table, + ACE_Thread_Descriptor [this->current_count_], + -1); for (size_t i = 0; i < this->current_count_; i++) if (this->thr_table_[i].task_ == task) @@ -957,7 +964,7 @@ ACE_Thread_Manager::wait_task (ACE_Task_Base *task) if (ACE_Thread::join (copy_table[i].thr_handle_) == -1) result = -1; - delete []copy_table; + delete [] copy_table; return result; } |