diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-02a | 7 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-03a | 7 | ||||
-rw-r--r-- | ace/Proactor.cpp | 22 | ||||
-rw-r--r-- | ace/Proactor.h | 7 | ||||
-rw-r--r-- | ace/Proactor.i | 5 | ||||
-rw-r--r-- | ace/Reactor.i | 36 |
7 files changed, 69 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog index 997ab3dc110..764d8f4fd33 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ Mon Dec 24 08:08:40 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu> + * ace/Proactor.i (run_event_loop): Refactored the code to + use the new ACE_Proactor::check_reconfiguration() static method, + just like the Reactor! + + * ace/Proactor.h: Added the check_reconfiguration() static method + to ACE_Proactor, a la the Reactor! + * ace/Reactor.h: Changed the signature of ACE_Reactor::check_reconfiguration() to reflect the following change. diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a index 997ab3dc110..764d8f4fd33 100644 --- a/ChangeLogs/ChangeLog-02a +++ b/ChangeLogs/ChangeLog-02a @@ -1,5 +1,12 @@ Mon Dec 24 08:08:40 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu> + * ace/Proactor.i (run_event_loop): Refactored the code to + use the new ACE_Proactor::check_reconfiguration() static method, + just like the Reactor! + + * ace/Proactor.h: Added the check_reconfiguration() static method + to ACE_Proactor, a la the Reactor! + * ace/Reactor.h: Changed the signature of ACE_Reactor::check_reconfiguration() to reflect the following change. diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a index 997ab3dc110..764d8f4fd33 100644 --- a/ChangeLogs/ChangeLog-03a +++ b/ChangeLogs/ChangeLog-03a @@ -1,5 +1,12 @@ Mon Dec 24 08:08:40 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu> + * ace/Proactor.i (run_event_loop): Refactored the code to + use the new ACE_Proactor::check_reconfiguration() static method, + just like the Reactor! + + * ace/Proactor.h: Added the check_reconfiguration() static method + to ACE_Proactor, a la the Reactor! + * ace/Reactor.h: Changed the signature of ACE_Reactor::check_reconfiguration() to reflect the following change. diff --git a/ace/Proactor.cpp b/ace/Proactor.cpp index 6b6cf2fbedb..22880a97363 100644 --- a/ace/Proactor.cpp +++ b/ace/Proactor.cpp @@ -4,6 +4,9 @@ #include "ace/Proactor_Impl.h" #include "ace/Object_Manager.h" #include "ace/Task_T.h" +#if !defined (ACE_HAS_WINCE) && !defined (ACE_LACKS_ACE_SVCCONF) +# include "ace/Service_Config.h" +# endif /* !ACE_HAS_WINCE && !ACE_LACKS_ACE_SVCCONF */ #if !defined (__ACE_INLINE__) #include "ace/Proactor.i" @@ -340,6 +343,19 @@ ACE_Proactor::close_singleton (void) } int +ACE_Proactor::check_reconfiguration (ACE_Proactor *) +{ +#if !defined (ACE_HAS_WINCE) && !defined (ACE_LACKS_ACE_SVCCONF) + if (ACE_Service_Config::reconfig_occurred ()) + { + ACE_Service_Config::reconfigure (); + return 1; + } +#endif /* ! ACE_HAS_WINCE || ! ACE_LACKS_ACE_SVCCONF */ + return 0; +} + +int ACE_Proactor::proactor_run_event_loop (PROACTOR_EVENT_HOOK eh) { ACE_TRACE ("ACE_Proactor::proactor_run_event_loop"); @@ -371,9 +387,6 @@ ACE_Proactor::proactor_run_event_loop (PROACTOR_EVENT_HOOK eh) if (eh != 0 && (*eh) (this)) continue; - if (ACE_Service_Config::reconfig_occurred ()) - ACE_Service_Config::reconfigure (); - if (result == -1) break; } @@ -431,9 +444,6 @@ ACE_Proactor::proactor_run_event_loop (ACE_Time_Value &tv, if (eh != 0 && (*eh) (this)) continue; - if (ACE_Service_Config::reconfig_occurred ()) - ACE_Service_Config::reconfigure (); - if (result == -1) break; } diff --git a/ace/Proactor.h b/ace/Proactor.h index 5b72a6e2bf9..352817b4764 100644 --- a/ace/Proactor.h +++ b/ace/Proactor.h @@ -200,6 +200,13 @@ public: */ static int reset_event_loop (void); + /** + * The singleton proactor is used by the <ACE_Service_Config>. + * Therefore, we must check for the reconfiguration request and + * handle it after handling an event. + */ + static int check_reconfiguration (ACE_Proactor *); + /// Report if the <ACE_Proactor::instance> event loop is finished. static int event_loop_done (void); diff --git a/ace/Proactor.i b/ace/Proactor.i index e876b6e8b0c..d7ae2dd0b52 100644 --- a/ace/Proactor.i +++ b/ace/Proactor.i @@ -10,7 +10,7 @@ ACE_Proactor::run_event_loop (void) if (p == 0) return -1; - return p->proactor_run_event_loop (); + return p->proactor_run_event_loop (ACE_Proactor::check_reconfiguration); } int @@ -22,7 +22,8 @@ ACE_Proactor::run_event_loop (ACE_Time_Value &tv) if (p == 0) return -1; - return p->proactor_run_event_loop (tv); + return p->proactor_run_event_loop + (tv, ACE_Proactor::check_reconfiguration); } int diff --git a/ace/Reactor.i b/ace/Reactor.i index 42f1b53795b..d0c5610a22e 100644 --- a/ace/Reactor.i +++ b/ace/Reactor.i @@ -30,10 +30,12 @@ ACE_INLINE int ACE_Reactor::run_event_loop (void) { ACE_TRACE ("ACE_Reactor::run_event_loop"); + ACE_Reactor *r = ACE_Reactor::instance (); - return - ACE_Reactor::instance () - ->run_reactor_event_loop (ACE_Reactor::check_reconfiguration); + if (r == 0) + return -1; + + return r->run_reactor_event_loop (ACE_Reactor::check_reconfiguration); } // Run the event loop until the <ACE_Reactor::handle_events> @@ -44,11 +46,13 @@ ACE_INLINE int ACE_Reactor::run_event_loop (ACE_Time_Value &tv) { ACE_TRACE ("ACE_Reactor::run_event_loop"); + ACE_Reactor *r = ACE_Reactor::instance (); + + if (r == 0) + return -1; - return - ACE_Reactor::instance () - ->run_reactor_event_loop (tv, - ACE_Reactor::check_reconfiguration); + return r->run_reactor_event_loop + (tv, ACE_Reactor::check_reconfiguration); } // Run the event loop until the <ACE_Reactor::alertable_handle_events> method @@ -58,10 +62,12 @@ ACE_INLINE int ACE_Reactor::run_alertable_event_loop (void) { ACE_TRACE ("ACE_Reactor::run_alertable_event_loop"); + ACE_Reactor *r = ACE_Reactor::instance (); - return - ACE_Reactor::instance () - ->run_alertable_reactor_event_loop (ACE_Reactor::check_reconfiguration); + if (r == 0) + return -1; + + return r->run_alertable_reactor_event_loop (ACE_Reactor::check_reconfiguration); } // Run the event loop until the <ACE_Reactor::alertable_handle_events> @@ -72,11 +78,13 @@ ACE_INLINE int ACE_Reactor::run_alertable_event_loop (ACE_Time_Value &tv) { ACE_TRACE ("ACE_Reactor::run_alertable_event_loop"); + ACE_Reactor *r = ACE_Reactor::instance (); + + if (r == 0) + return -1; - return - ACE_Reactor::instance () - ->run_alertable_reactor_event_loop (tv, - ACE_Reactor::check_reconfiguration); + return r->run_alertable_reactor_event_loop + (tv, ACE_Reactor::check_reconfiguration); } ACE_INLINE void |