diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 2003-07-14 18:15:12 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 2003-07-14 18:15:12 +0000 |
commit | 054faede89b80e155ea2787c070f24697de2cef4 (patch) | |
tree | 9eb47d30fe92d7a4e7de8815e74502cd275fa9c5 /ace | |
parent | b7add7e5e2c4f2b8941d9d10a8ee87e5d3959ac9 (diff) | |
download | ATCD-054faede89b80e155ea2787c070f24697de2cef4.tar.gz |
ChangeLogTag:Mon Jul 14 11:16:25 2003 Craig Rodrigues <crodrigu@bbn.com>
Diffstat (limited to 'ace')
-rw-r--r-- | ace/Future.h | 9 | ||||
-rw-r--r-- | ace/Handle_Set.cpp | 2 | ||||
-rw-r--r-- | ace/Message_Queue_T.cpp | 76 | ||||
-rw-r--r-- | ace/OS_Dirent.inl | 1 | ||||
-rw-r--r-- | ace/POSIX_Proactor.cpp | 11 |
5 files changed, 46 insertions, 53 deletions
diff --git a/ace/Future.h b/ace/Future.h index e91a659d115..c91fca7a8ca 100644 --- a/ace/Future.h +++ b/ace/Future.h @@ -36,7 +36,7 @@ template <class T> class ACE_Future; /** * @class ACE_Future_Holder * - * @brief Implementation of object which has holds ACE_Future. + * @brief Implementation of object that holds an ACE_Future. */ template <class T> class ACE_Future_Holder @@ -60,10 +60,9 @@ protected: * @brief ACE_Future_Observer<T> * * An ACE_Future_Observer object implements an object that is - * subscribed with an ACE_Future object so that it may be - * notified when the value of the ACE_Future object is - * written to by a writer thread. - * It uses the Observer pattern + * subscribed with an ACE_Future object so that it may be notified + * when the value of the ACE_Future object is written to by a writer + * thread. It uses the Observer pattern. */ template <class T> class ACE_Future_Observer diff --git a/ace/Handle_Set.cpp b/ace/Handle_Set.cpp index a6a56370c9a..3a9f92526fd 100644 --- a/ace/Handle_Set.cpp +++ b/ace/Handle_Set.cpp @@ -372,7 +372,7 @@ ACE_Handle_Set_Iterator::operator () (void) while (lsb == 0); // Set index to word boundary. - this->handle_index_ = ACE_MULT_BY_WORDSIZE(this->word_num_); + this->handle_index_ = ACE_MULT_BY_WORDSIZE (this->word_num_); // Put new word_val. this->word_val_ = lsb; diff --git a/ace/Message_Queue_T.cpp b/ace/Message_Queue_T.cpp index 1f0e5f71cfb..9e7cb2cf650 100644 --- a/ace/Message_Queue_T.cpp +++ b/ace/Message_Queue_T.cpp @@ -852,8 +852,7 @@ ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_head_i (ACE_Message_Block *&first_item if (this->head_ == 0) this->tail_ = 0; else - // The prev pointer of the first message block has to point to - // NULL... + // The prev pointer of first message block must point to 0... this->head_->prev (0); size_t mb_bytes = 0; @@ -868,6 +867,10 @@ ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_head_i (ACE_Message_Block *&first_item if (this->cur_count_ == 0 && this->head_ == this->tail_) this->head_ = this->tail_ = 0; + // Make sure that the prev and next fields are 0! + first_item->prev (0); + first_item->next (0); + // Only signal enqueueing threads if we've fallen below the low // water mark. if (this->cur_bytes_ <= this->low_water_mark_ @@ -904,29 +907,20 @@ ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_prio_i (ACE_Message_Block *&dequeued) // If every message block is the same priority, pass back the first one if (chosen == 0) - { - chosen = this->head_; - } + chosen = this->head_; + // Patch up the queue. If we don't have a previous // then we are at the head of the queue. if (chosen->prev () == 0) - { - this->head_ = chosen->next (); - } + this->head_ = chosen->next (); else - { - chosen->prev ()->next (chosen->next ()); - } + chosen->prev ()->next (chosen->next ()); if (chosen->next () == 0) - { - this->tail_ = chosen->prev (); - } + this->tail_ = chosen->prev (); else - { - chosen->next ()->prev (chosen->prev ()); - } + chosen->next ()->prev (chosen->prev ()); // Pass back the chosen block dequeued = chosen; @@ -943,6 +937,10 @@ ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_prio_i (ACE_Message_Block *&dequeued) if (this->cur_count_ == 0 && this->head_ == this->tail_) this->head_ = this->tail_ = 0; + // Make sure that the prev and next fields are 0! + dequeued->prev (0); + dequeued->next (0); + // Only signal enqueueing threads if we've fallen below the low // water mark. if (this->cur_bytes_ <= this->low_water_mark_ @@ -988,6 +986,10 @@ ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_tail_i (ACE_Message_Block *&dequeued) if (this->cur_count_ == 0 && this->head_ == this->tail_) this->head_ = this->tail_ = 0; + // Make sure that the prev and next fields are 0! + dequeued->prev (0); + dequeued->next (0); + // Only signal enqueueing threads if we've fallen below the low // water mark. if (this->cur_bytes_ <= this->low_water_mark_ @@ -1015,40 +1017,28 @@ ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_deadline_i (ACE_Message_Block *&dequeu ACE_Message_Block* chosen = 0; ACE_Time_Value deadline = ACE_Time_Value::max_time; for (ACE_Message_Block *temp = this->head_; temp != 0; temp = temp->next ()) - { - if (temp->msg_deadline_time () < deadline) - { - deadline = temp->msg_deadline_time (); - chosen = temp; - } - } + if (temp->msg_deadline_time () < deadline) + { + deadline = temp->msg_deadline_time (); + chosen = temp; + } // If every message block is the same deadline time, // pass back the first one if (chosen == 0) - { - chosen = this->head_; - } + chosen = this->head_; // Patch up the queue. If we don't have a previous // then we are at the head of the queue. if (chosen->prev () == 0) - { - this->head_ = chosen->next (); - } + this->head_ = chosen->next (); else - { - chosen->prev ()->next (chosen->next ()); - } + chosen->prev ()->next (chosen->next ()); if (chosen->next () == 0) - { - this->tail_ = chosen->prev (); - } + this->tail_ = chosen->prev (); else - { - chosen->next ()->prev (chosen->prev ()); - } + chosen->next ()->prev (chosen->prev ()); // Pass back the chosen block dequeued = chosen; @@ -1065,6 +1055,10 @@ ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_deadline_i (ACE_Message_Block *&dequeu if (this->cur_count_ == 0 && this->head_ == this->tail_) this->head_ = this->tail_ = 0; + // Make sure that the prev and next fields are 0! + dequeued->prev (0); + dequeued->next (0); + // Only signal enqueueing threads if we've fallen below the low // water mark. if (this->cur_bytes_ <= this->low_water_mark_ @@ -1102,8 +1096,8 @@ ACE_Message_Queue<ACE_SYNCH_USE>::peek_dequeue_head (ACE_Message_Block *&first_i } template <ACE_SYNCH_DECL> int -ACE_Message_Queue<ACE_SYNCH_USE>::wait_not_full_cond - (ACE_Guard<ACE_SYNCH_MUTEX_T> &, ACE_Time_Value *timeout) +ACE_Message_Queue<ACE_SYNCH_USE>::wait_not_full_cond (ACE_Guard<ACE_SYNCH_MUTEX_T> &, + ACE_Time_Value *timeout) { int result = 0; diff --git a/ace/OS_Dirent.inl b/ace/OS_Dirent.inl index c1f227fbb78..314f33f32da 100644 --- a/ace/OS_Dirent.inl +++ b/ace/OS_Dirent.inl @@ -109,6 +109,7 @@ ACE_OS_Dirent::readdir_r (ACE_DIR *dirp, (!defined (sun) && (defined (ACE_HAS_PTHREADS_STD) || \ defined (ACE_HAS_PTHREADS_DRAFT7) || \ defined (__USE_POSIX) || \ + defined (__FreeBSD__) || \ defined (HPUX_11))) # if defined (__GNUG__) && defined (DIGITAL_UNIX) return readdir_r (dirp, entry, result); diff --git a/ace/POSIX_Proactor.cpp b/ace/POSIX_Proactor.cpp index 6dda757c3dd..b28b38a0430 100644 --- a/ace/POSIX_Proactor.cpp +++ b/ace/POSIX_Proactor.cpp @@ -927,17 +927,16 @@ void ACE_POSIX_AIOCB_Proactor::check_max_aio_num () aiocb_list_max_size_ > (unsigned long) max_os_aio_num) aiocb_list_max_size_ = max_os_aio_num; -#if defined (HPUX) - // Although HPUX 11.00 allows to start 2048 AIO's - // for all process in system - // it has a limit 256 max elements for aio_suspend () - // It is a pity, but ... +#if defined (HPUX) || defined (__FreeBSD__) + // Although HPUX 11.00 allows to start 2048 AIO's for all process in + // system it has a limit 256 max elements for aio_suspend () It is a + // pity, but ... long max_os_listio_num = ACE_OS::sysconf (_SC_AIO_LISTIO_MAX); if (max_os_listio_num > 0 && aiocb_list_max_size_ > (unsigned long) max_os_listio_num) aiocb_list_max_size_ = max_os_listio_num; -#endif /* HPUX */ +#endif /* HPUX || __FreeBSD__ */ // check for user-defined value // ACE_AIO_MAX_SIZE if defined in POSIX_Proactor.h |