diff options
author | bala <balanatarajan@users.noreply.github.com> | 2001-06-28 20:33:31 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2001-06-28 20:33:31 +0000 |
commit | 7a1d24e82359c07f81f7d33e8fcc1a8787857782 (patch) | |
tree | 43bc7c5bfd52e89910139f3deded58924d99f1f6 | |
parent | 1feb09ca2fe3645415fd5e5a71c9c9f947311271 (diff) | |
download | ATCD-7a1d24e82359c07f81f7d33e8fcc1a8787857782.tar.gz |
ChangeLogTag:Thu Jun 28 15:25:07 2001 Balachandran Natarajan <bala@cs.wustl.edu>
-rw-r--r-- | ace/Reactor.cpp | 8 | ||||
-rw-r--r-- | ace/Reactor.h | 10 | ||||
-rw-r--r-- | ace/Reactor_Impl.h | 9 | ||||
-rw-r--r-- | ace/Select_Reactor_Base.cpp | 25 | ||||
-rw-r--r-- | ace/Select_Reactor_Base.h | 6 | ||||
-rw-r--r-- | ace/TP_Reactor.cpp | 6 | ||||
-rw-r--r-- | ace/TP_Reactor.h | 6 | ||||
-rw-r--r-- | ace/WFMO_Reactor.cpp | 8 | ||||
-rw-r--r-- | ace/WFMO_Reactor.h | 10 |
9 files changed, 73 insertions, 15 deletions
diff --git a/ace/Reactor.cpp b/ace/Reactor.cpp index f8b65761cc9..703fbef3cdb 100644 --- a/ace/Reactor.cpp +++ b/ace/Reactor.cpp @@ -267,6 +267,13 @@ ACE_Reactor::reset_reactor_event_loop (void) // Resets the <ACE_Reactor::end_event_loop_> static so that the // <run_event_loop> method can be restarted. + +int +ACE_Reactor::resumable_handler (void) +{ + return this->implementation ()->resumable_handler (); +} + void ACE_Reactor::dump (void) const { @@ -274,4 +281,3 @@ ACE_Reactor::dump (void) const implementation_->dump (); } - diff --git a/ace/Reactor.h b/ace/Reactor.h index 038f5eef7bb..5a2e9ce88c2 100644 --- a/ace/Reactor.h +++ b/ace/Reactor.h @@ -397,6 +397,12 @@ public: /// Resume all <handles>. virtual int resume_handlers (void); + /// Does the reactor allow the application to resume the handle on + /// its own ie. can it pass on the control of handle resumption to + /// the application. A positive value indicates that the handlers + /// are application resumable. A value of 0 indicates otherwise. + virtual int resumable_handler (void); + // = Timer management. /** @@ -411,11 +417,11 @@ public: * @see reset_timer_interval() * * @param event_handler event handler to schedule on reactor - * @param arg argument passed to the handle_timeout() method of event_handler + * @param arg argument passed to the handle_timeout() method of event_handler * @param delta time interval after which the timer will expire * @param interval time interval after which the timer will be automatically rescheduled * @return -1 on failure, a timer_id value on success - */ + */ virtual long schedule_timer (ACE_Event_Handler *event_handler, const void *arg, const ACE_Time_Value &delay, diff --git a/ace/Reactor_Impl.h b/ace/Reactor_Impl.h index b6a15d753d1..a6c4403b4cd 100644 --- a/ace/Reactor_Impl.h +++ b/ace/Reactor_Impl.h @@ -334,6 +334,11 @@ public: /// Resume all <handles>. virtual int resume_handlers (void) = 0; + /// Does the reactor allow the application to resume the handle on + /// its own ie. can it pass on the control of handle resumption to + /// the application + virtual int resumable_handler (void) = 0; + /// Return 1 if we any event associations were made by the reactor /// for the handles that it waits on, 0 otherwise. virtual int uses_event_associations (void) = 0; @@ -354,11 +359,11 @@ public: * @see reset_timer_interval() * * @param event_handler event handler to schedule on reactor - * @param arg argument passed to the handle_timeout() method of event_handler + * @param arg argument passed to the handle_timeout() method of event_handler * @param delta time interval after which the timer will expire * @param interval time interval after which the timer will be automatically rescheduled * @return -1 on failure, a timer_id value on success - */ + */ virtual long schedule_timer (ACE_Event_Handler *event_handler, const void *arg, const ACE_Time_Value &delay, diff --git a/ace/Select_Reactor_Base.cpp b/ace/Select_Reactor_Base.cpp index c398a82c620..b3a12c9e20a 100644 --- a/ace/Select_Reactor_Base.cpp +++ b/ace/Select_Reactor_Base.cpp @@ -578,7 +578,7 @@ ACE_Select_Reactor_Notify::open (ACE_Reactor_Impl *r, if (disable_notify_pipe == 0) { - this->select_reactor_ = + this->select_reactor_ = ACE_dynamic_cast (ACE_Select_Reactor_Impl *, r); if (select_reactor_ == 0) @@ -596,7 +596,7 @@ ACE_Select_Reactor_Notify::open (ACE_Reactor_Impl *r, #if defined (ACE_HAS_REACTOR_NOTIFICATION_QUEUE) ACE_Notification_Buffer *temp; - + ACE_NEW_RETURN (temp, ACE_Notification_Buffer[ACE_REACTOR_NOTIFICATION_ARRAY_SIZE], -1); @@ -673,16 +673,16 @@ ACE_Select_Reactor_Notify::notify (ACE_Event_Handler *eh, ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, mon, this->notify_queue_lock_, -1); // No pending notifications. - if (this->notify_queue_.is_empty ()) + if (this->notify_queue_.is_empty ()) notification_required = 1; ACE_Notification_Buffer *temp = 0; - if (free_queue_.dequeue_head (temp) == -1) + if (free_queue_.dequeue_head (temp) == -1) { // Grow the queue of available buffers. ACE_Notification_Buffer *temp1; - + ACE_NEW_RETURN (temp1, ACE_Notification_Buffer[ACE_REACTOR_NOTIFICATION_ARRAY_SIZE], -1); @@ -693,11 +693,11 @@ ACE_Select_Reactor_Notify::notify (ACE_Event_Handler *eh, // Start at 1 and enqueue only // (ACE_REACTOR_NOTIFICATION_ARRAY_SIZE - 1) elements since // the first one will be used right now. - for (size_t i = 1; - i < ACE_REACTOR_NOTIFICATION_ARRAY_SIZE; + for (size_t i = 1; + i < ACE_REACTOR_NOTIFICATION_ARRAY_SIZE; i++) this->free_queue_.enqueue_head (temp1 + i); - + temp = temp1; } @@ -1004,6 +1004,15 @@ ACE_Select_Reactor_Impl::bit_ops (ACE_HANDLE handle, return omask; } +int +ACE_Select_Reactor_Impl::resumable_handler (void) +{ + // The select reactor has no handlers that can be resumed by the + // application. So return 0; + + return 0; +} + #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) #if defined (ACE_HAS_REACTOR_NOTIFICATION_QUEUE) template class ACE_Unbounded_Queue <ACE_Notification_Buffer *>; diff --git a/ace/Select_Reactor_Base.h b/ace/Select_Reactor_Base.h index 2ec0874db1e..e1df16ab005 100644 --- a/ace/Select_Reactor_Base.h +++ b/ace/Select_Reactor_Base.h @@ -402,6 +402,12 @@ public: */ virtual int purge_pending_notifications (ACE_Event_Handler * = 0); + /// Does the reactor allow the application to resume the handle on + /// its own ie. can it pass on the control of handle resumption to + /// the application. The select reactor has no handlers that can be + /// resumed by the application. So return 0; + virtual int resumable_handler (void); + protected: /// Allow manipulation of the <wait_set_> mask and <ready_set_> mask. virtual int bit_ops (ACE_HANDLE handle, diff --git a/ace/TP_Reactor.cpp b/ace/TP_Reactor.cpp index 4938ee50338..8b0cbecc95d 100644 --- a/ace/TP_Reactor.cpp +++ b/ace/TP_Reactor.cpp @@ -430,6 +430,12 @@ ACE_TP_Reactor::notify_handle (ACE_EH_Dispatch_Info &dispatch_info) return 0; } +int +ACE_TP_Reactor::resumable_handler (void) +{ + return 1; +} + ACE_EH_Dispatch_Info::ACE_EH_Dispatch_Info (void) { diff --git a/ace/TP_Reactor.h b/ace/TP_Reactor.h index dab47eedda7..65f85383058 100644 --- a/ace/TP_Reactor.h +++ b/ace/TP_Reactor.h @@ -151,6 +151,12 @@ public: virtual int handle_events (ACE_Time_Value &max_wait_time); + /// Does the reactor allow the application to resume the handle on + /// its own ie. can it pass on the control of handle resumption to + /// the application. The TP reactor has can allow applications to + /// resume handles. So return a +ve value. + virtual int resumable_handler (void); + /// GET/SET/ADD/CLR the dispatch mask "bit" bound with the <eh> and /// <mask>. virtual int mask_ops (ACE_Event_Handler *eh, diff --git a/ace/WFMO_Reactor.cpp b/ace/WFMO_Reactor.cpp index a661b7733fa..4a5ab8657c3 100644 --- a/ace/WFMO_Reactor.cpp +++ b/ace/WFMO_Reactor.cpp @@ -2467,6 +2467,14 @@ ACE_WFMO_Reactor::purge_pending_notifications (ACE_Event_Handler *eh) return this->notify_handler_->purge_pending_notifications (eh); } +int +ACE_WFMO_Reactor::resumable_handler (void) +{ + ACE_TRACE ("ACE_WFMO_Reactor::resumable_handler"); + return 0; +} + + // No-op WinSOCK2 methods to help WFMO_Reactor compile #if !defined (ACE_HAS_WINSOCK2) || (ACE_HAS_WINSOCK2 == 0) int diff --git a/ace/WFMO_Reactor.h b/ace/WFMO_Reactor.h index d98bdd4612b..896130d70fe 100644 --- a/ace/WFMO_Reactor.h +++ b/ace/WFMO_Reactor.h @@ -882,6 +882,12 @@ public: /// Resume all <handles>. virtual int resume_handlers (void); + /// Does the reactor allow the application to resume the handle on + /// its own ie. can it pass on the control of handle resumption to + /// the application. A positive value indicates that the handlers + /// are application resumable. A value of 0 indicates otherwise. + virtual int resumable_handler (void); + /** * Return 1 if we any event associations were made by the reactor * for the handles that it waits on, 0 otherwise. Since the @@ -904,11 +910,11 @@ public: * @see reset_timer_interval() * * @param event_handler event handler to schedule on reactor - * @param arg argument passed to the handle_timeout() method of event_handler + * @param arg argument passed to the handle_timeout() method of event_handler * @param delta time interval after which the timer will expire * @param interval time interval after which the timer will be automatically rescheduled * @return -1 on failure, a timer_id value on success - */ + */ virtual long schedule_timer (ACE_Event_Handler *event_handler, const void *arg, const ACE_Time_Value &delay, |