diff options
-rw-r--r-- | ChangeLog | 21 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-02a | 21 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-03a | 21 | ||||
-rw-r--r-- | ace/WFMO_Reactor.cpp | 71 |
4 files changed, 110 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog index eb426435c9a..62faef82648 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +Thu Mar 30 19:25:14 2000 Irfan Pyarali <irfan@cs.wustl.edu> + + * ace/WFMO_Reactor.cpp (suspend_handler_i and resume_handler_i): + + If a handle is resumed, then: + + - check current handles to undo suspension (*) + - check suspended handles to resume + - check to_be_added handles to undo suspension + + If a handle is suspended, then: + + - check current handles to suspend + - check suspended handles to undo resumption (*) + - check to_be_added handles to suspend + + (*) were missing. Thanks to Ji Wuliu <jiwuliu0952_cn@sina.com> + for pointing this out! + Thu Mar 30 15:54:23 2000 Steve Huston <shuston@riverace.com> * ace/config-aix-4.x.h: Only set ACE_HAS_SIGTIMEDWAIT for AIX @@ -8,7 +27,7 @@ Thu Mar 30 15:54:23 2000 Steve Huston <shuston@riverace.com> Wed Mar 29 00:01:39 2000 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> - * netsvcs/lib/Client_Logging_Handler.cpp (handle_input): + * netsvcs/lib/Client_Logging_Handler.cpp (handle_input): ACE_OS::closesocket() was being used to do some very "low-level" closing of handles without assigning a handle to ACE_INVALID_HANDLE. This was causing problems. Therefore, we diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a index eb426435c9a..62faef82648 100644 --- a/ChangeLogs/ChangeLog-02a +++ b/ChangeLogs/ChangeLog-02a @@ -1,3 +1,22 @@ +Thu Mar 30 19:25:14 2000 Irfan Pyarali <irfan@cs.wustl.edu> + + * ace/WFMO_Reactor.cpp (suspend_handler_i and resume_handler_i): + + If a handle is resumed, then: + + - check current handles to undo suspension (*) + - check suspended handles to resume + - check to_be_added handles to undo suspension + + If a handle is suspended, then: + + - check current handles to suspend + - check suspended handles to undo resumption (*) + - check to_be_added handles to suspend + + (*) were missing. Thanks to Ji Wuliu <jiwuliu0952_cn@sina.com> + for pointing this out! + Thu Mar 30 15:54:23 2000 Steve Huston <shuston@riverace.com> * ace/config-aix-4.x.h: Only set ACE_HAS_SIGTIMEDWAIT for AIX @@ -8,7 +27,7 @@ Thu Mar 30 15:54:23 2000 Steve Huston <shuston@riverace.com> Wed Mar 29 00:01:39 2000 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> - * netsvcs/lib/Client_Logging_Handler.cpp (handle_input): + * netsvcs/lib/Client_Logging_Handler.cpp (handle_input): ACE_OS::closesocket() was being used to do some very "low-level" closing of handles without assigning a handle to ACE_INVALID_HANDLE. This was causing problems. Therefore, we diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a index eb426435c9a..62faef82648 100644 --- a/ChangeLogs/ChangeLog-03a +++ b/ChangeLogs/ChangeLog-03a @@ -1,3 +1,22 @@ +Thu Mar 30 19:25:14 2000 Irfan Pyarali <irfan@cs.wustl.edu> + + * ace/WFMO_Reactor.cpp (suspend_handler_i and resume_handler_i): + + If a handle is resumed, then: + + - check current handles to undo suspension (*) + - check suspended handles to resume + - check to_be_added handles to undo suspension + + If a handle is suspended, then: + + - check current handles to suspend + - check suspended handles to undo resumption (*) + - check to_be_added handles to suspend + + (*) were missing. Thanks to Ji Wuliu <jiwuliu0952_cn@sina.com> + for pointing this out! + Thu Mar 30 15:54:23 2000 Steve Huston <shuston@riverace.com> * ace/config-aix-4.x.h: Only set ACE_HAS_SIGTIMEDWAIT for AIX @@ -8,7 +27,7 @@ Thu Mar 30 15:54:23 2000 Steve Huston <shuston@riverace.com> Wed Mar 29 00:01:39 2000 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> - * netsvcs/lib/Client_Logging_Handler.cpp (handle_input): + * netsvcs/lib/Client_Logging_Handler.cpp (handle_input): ACE_OS::closesocket() was being used to do some very "low-level" closing of handles without assigning a handle to ACE_INVALID_HANDLE. This was causing problems. Therefore, we diff --git a/ace/WFMO_Reactor.cpp b/ace/WFMO_Reactor.cpp index 8091712966a..c936137b13c 100644 --- a/ace/WFMO_Reactor.cpp +++ b/ace/WFMO_Reactor.cpp @@ -431,14 +431,13 @@ int ACE_WFMO_Reactor_Handler_Repository::suspend_handler_i (ACE_HANDLE handle, int &changes_required) { - // Remember this value; only if it changes do we need to wakeup - // the other threads - size_t original_handle_count = this->handles_to_be_suspended_; size_t i = 0; // Go through all the handles looking for <handle>. Even if we find // it, we continue through the rest of the list since <handle> could // appear multiple times. All handles are checked. + + // Check the current entries first. for (i = 0; i < this->max_handlep1_; i++) // Since the handle can either be the event or the I/O handle, // we have to check both @@ -451,9 +450,28 @@ ACE_WFMO_Reactor_Handler_Repository::suspend_handler_i (ACE_HANDLE handle, this->current_info_[i].suspend_entry_ = 1; // Increment the handle count this->handles_to_be_suspended_++; + // Changes will be required + changes_required = 1; } - // Then check the to_be_added entries + // Then check the suspended entries. + for (i = 0; i < this->suspended_handles_; i++) + // Since the handle can either be the event or the I/O handle, + // we have to check both + if ((this->current_suspended_info_[i].event_handle_ == handle || + this->current_suspended_info_[i].io_handle_ == handle) && + // Make sure that the resumption is not already undone + this->current_suspended_info_[i].resume_entry_) + { + // Undo resumption + this->current_suspended_info_[i].resume_entry_ = 0; + // Decrement the handle count + this->handles_to_be_resumed_--; + // Changes will be required + changes_required = 1; + } + + // Then check the to_be_added entries. for (i = 0; i < this->handles_to_be_added_; i++) // Since the handle can either be the event or the I/O handle, // we have to check both @@ -466,13 +484,10 @@ ACE_WFMO_Reactor_Handler_Repository::suspend_handler_i (ACE_HANDLE handle, this->to_be_added_info_[i].suspend_entry_ = 1; // Increment the handle count this->handles_to_be_suspended_++; + // Changes will be required + changes_required = 1; } - // Only if the number of handlers to be deleted changes do we need - // to wakeup the other threads - if (original_handle_count < this->handles_to_be_suspended_) - changes_required = 1; - return 0; } @@ -480,15 +495,30 @@ int ACE_WFMO_Reactor_Handler_Repository::resume_handler_i (ACE_HANDLE handle, int &changes_required) { - // Remember this value; only if it changes do we need to wakeup - // the other threads - size_t original_handle_count = this->handles_to_be_resumed_; + size_t i = 0; // Go through all the handles looking for <handle>. Even if we find // it, we continue through the rest of the list since <handle> could // appear multiple times. All handles are checked. - size_t i = 0; + // Check the current entries first. + for (i = 0; i < this->max_handlep1_; i++) + // Since the handle can either be the event or the I/O handle, + // we have to check both + if ((this->current_handles_[i] == handle || + this->current_info_[i].io_handle_ == handle) && + // Make sure that the suspension is not already undone + this->current_info_[i].suspend_entry_) + { + // Undo suspension + this->current_info_[i].suspend_entry_ = 0; + // Decrement the handle count + this->handles_to_be_suspended_--; + // Changes will be required + changes_required = 1; + } + + // Then check the suspended entries. for (i = 0; i < this->suspended_handles_; i++) // Since the handle can either be the event or the I/O handle, // we have to check both @@ -501,28 +531,27 @@ ACE_WFMO_Reactor_Handler_Repository::resume_handler_i (ACE_HANDLE handle, this->current_suspended_info_[i].resume_entry_ = 1; // Increment the handle count this->handles_to_be_resumed_++; + // Changes will be required + changes_required = 1; } - // Then check the to_be_added entries + // Then check the to_be_added entries. for (i = 0; i < this->handles_to_be_added_; i++) // Since the handle can either be the event or the I/O handle, // we have to check both if ((this->to_be_added_info_[i].io_handle_ == handle || this->to_be_added_info_[i].event_handle_ == handle) && - // Make sure that it is not already marked for resumption + // Make sure that the suspension is not already undone this->to_be_added_info_[i].suspend_entry_) { - // Mark to be resumed + // Undo suspension this->to_be_added_info_[i].suspend_entry_ = 0; // Decrement the handle count this->handles_to_be_suspended_--; + // Changes will be required + changes_required = 1; } - // Only if the number of handlers to be deleted changes do we need - // to wakeup the other threads - if (original_handle_count < this->handles_to_be_resumed_) - changes_required = 1; - return 0; } |