summaryrefslogtreecommitdiff
path: root/ace/WFMO_Reactor.cpp
diff options
context:
space:
mode:
authorirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-11-21 15:55:41 +0000
committerirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-11-21 15:55:41 +0000
commit74b953f078e525defc7672c58d6291a7c7f3b15f (patch)
tree3fb9d91c94013084361617a1cee11945c1600e6e /ace/WFMO_Reactor.cpp
parent7f8fa700f29b02601674453dd89694d0ed117f8f (diff)
downloadATCD-74b953f078e525defc7672c58d6291a7c7f3b15f.tar.gz
*** empty log message ***
Diffstat (limited to 'ace/WFMO_Reactor.cpp')
-rw-r--r--ace/WFMO_Reactor.cpp75
1 files changed, 39 insertions, 36 deletions
diff --git a/ace/WFMO_Reactor.cpp b/ace/WFMO_Reactor.cpp
index d82d017e26f..9509def874b 100644
--- a/ace/WFMO_Reactor.cpp
+++ b/ace/WFMO_Reactor.cpp
@@ -643,6 +643,36 @@ ACE_WFMO_Reactor::open (size_t size,
if (this->open_for_business_)
return -1;
+ // Timer Queue
+ if (this->delete_timer_queue_)
+ delete this->timer_queue_;
+
+ if (tq == 0)
+ {
+ ACE_NEW_RETURN (this->timer_queue_, ACE_Timer_Heap, -1);
+ this->delete_timer_queue_ = 1;
+ }
+ else
+ {
+ this->timer_queue_ = tq;
+ this->delete_timer_queue_ = 0;
+ }
+
+ // Signal Handler
+ if (this->delete_signal_handler_)
+ delete this->signal_handler_;
+
+ if (sh == 0)
+ {
+ ACE_NEW_RETURN (this->signal_handler_, ACE_Sig_Handler, -1);
+ this->delete_signal_handler_ = 1;
+ }
+ else
+ {
+ this->signal_handler_ = sh;
+ this->delete_signal_handler_ = 0;
+ }
+
// Setup the atomic wait array (used later in <handle_events>)
this->atomic_wait_array_[0] = this->lock_.lock ().proc_mutex_;
this->atomic_wait_array_[1] = this->ok_to_wait_.handle ();
@@ -660,6 +690,15 @@ ACE_WFMO_Reactor::open (size_t size,
else
this->delete_handler_rep_ = 1;
+ /* NOTE */
+ // The order of the following two registrations is very important
+
+ // Open the notification handler
+ if (this->notify_handler_.open (*this, this->timer_queue_) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR, "%p\n",
+ "opening notify handler "),
+ -1);
+
// Register for <wakeup_all_threads> event
if (this->register_handler (&this->wakeup_all_threads_handler_,
this->wakeup_all_threads_.handle ()) == -1)
@@ -678,42 +717,6 @@ ACE_WFMO_Reactor::open (size_t size,
this->wakeup_all_threads_.reset ();
}
- // Timer Queue
- if (this->delete_timer_queue_)
- delete this->timer_queue_;
-
- if (tq == 0)
- {
- ACE_NEW_RETURN (this->timer_queue_, ACE_Timer_Heap, -1);
- this->delete_timer_queue_ = 1;
- }
- else
- {
- this->timer_queue_ = tq;
- this->delete_timer_queue_ = 0;
- }
-
- // Open the notification handler
- if (this->notify_handler_.open (*this, this->timer_queue_) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n",
- "opening notify handler "),
- -1);
-
- // Signal Handler
- if (this->delete_signal_handler_)
- delete this->signal_handler_;
-
- if (sh == 0)
- {
- ACE_NEW_RETURN (this->signal_handler_, ACE_Sig_Handler, -1);
- this->delete_signal_handler_ = 1;
- }
- else
- {
- this->signal_handler_ = sh;
- this->delete_signal_handler_ = 0;
- }
-
// We are open for business
this->open_for_business_ = 1;