summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriliyan <iliyan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2008-03-28 16:18:32 +0000
committeriliyan <iliyan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2008-03-28 16:18:32 +0000
commit4234c0697cd34ee6dfd449e4d9048111ed5be055 (patch)
treee569979ac53bd037e4d69f9c5db7cd658ec1bcd7
parent9df46580e1ffe91f6dfed1f51a1f937741879125 (diff)
downloadATCD-4234c0697cd34ee6dfd449e4d9048111ed5be055.tar.gz
Merged revisions 81138-81139,81141,81144,81146 via svnmerge from
https://svn.dre.vanderbilt.edu/DOC/Middleware/trunk/ACE ........ r81138 | johnnyw | 2008-03-28 04:18:15 -0500 (Fri, 28 Mar 2008) | 1 line Fri Mar 28 09:17:57 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> ........ r81139 | johnnyw | 2008-03-28 04:18:51 -0500 (Fri, 28 Mar 2008) | 1 line Fri Mar 28 09:17:57 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> ........ r81141 | vzykov | 2008-03-28 04:28:18 -0500 (Fri, 28 Mar 2008) | 1 line ChangeLogTag: Fri Mar 28 09:24:25 UTC 2008 Vladimir Zykov <vladimir.zykov@prismtech.com> ........ r81144 | johnnyw | 2008-03-28 10:24:59 -0500 (Fri, 28 Mar 2008) | 1 line ........ r81146 | elliott_c | 2008-03-28 10:40:29 -0500 (Fri, 28 Mar 2008) | 1 line ChangeLogTag: Fri Mar 28 15:40:03 UTC 2008 Chad Elliott <elliott_c@ociweb.com> ........
-rw-r--r--ACE/ChangeLog41
-rw-r--r--ACE/ace/ACE.cpp9
-rw-r--r--ACE/ace/Hash_Map_Manager_T.cpp2
-rw-r--r--ACE/ace/High_Res_Timer.h2
-rw-r--r--ACE/ace/High_Res_Timer.inl3
-rw-r--r--ACE/ace/Reactor.h4
-rw-r--r--ACE/ace/Select_Reactor_Base.h2
-rw-r--r--ACE/ace/Select_Reactor_Base.inl4
-rw-r--r--ACE/ace/String_Base.cpp2
-rw-r--r--ACE/ace/WFMO_Reactor.cpp54
-rw-r--r--ACE/ace/WFMO_Reactor.h40
-rw-r--r--ACE/ace/WFMO_Reactor.inl125
-rw-r--r--ACE/bin/tao_orb_tests.lst1
-rw-r--r--ACE/tests/Reactor_Dispatch_Order_Test.cpp71
-rw-r--r--ACE/tests/unload_libace.mpb8
15 files changed, 241 insertions, 127 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index c0543828ee7..5b8dae96bee 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,44 @@
+Fri Mar 28 15:40:03 UTC 2008 Chad Elliott <elliott_c@ociweb.com>
+
+ * tests/unload_libace.mpb:
+
+ Inhert from vc_warnings instead of duplicating part of it's
+ functionality.
+
+Fri Mar 28 09:24:25 UTC 2008 Vladimir Zykov <vladimir.zykov@prismtech.com>
+
+ * bin/tao_orb_tests.lst:
+
+ Enabled a test to Bug_3276_Regression.
+
+Fri Mar 28 09:17:57 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * tests/Reactor_Dispatch_Order_Test.cpp:
+ Extended this test to also test suspend/resume_handlers and the
+ dev_poll reactor. Thanks to Russell Morra for extending this test
+
+ * ace/ACE.cpp:
+ * ace/High_Res_Timer.inl:
+ Layout changes
+
+ * ace/Hash_Map_Manager_T.cpp:
+ Use prefix increment instead of postfix
+
+ * ace/High_Res_Timer.h:
+ * ace/Reactor.h:
+ * ace/Select_Reactor_Base.h:
+ Doxygen changes
+
+ * ace/Select_Reactor_Base.inl:
+ Fixed done implementation. This fixes bugzilla 3267
+
+ * ace/String_Base.cpp:
+ Initialise pointer with 0
+
+ * ace/WFMO_Reactor.{h,cpp,inl}:
+ Bool changes, fixed implementation of suspend_handlers/resume_handlers,
+ the to_be_added set modifications where not done correctly
+
Thu Mar 27 19:09:57 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl>
* bin/tao_orb_tests.lst:
diff --git a/ACE/ace/ACE.cpp b/ACE/ace/ACE.cpp
index 233ef720f4c..d57ab3f7b26 100644
--- a/ACE/ace/ACE.cpp
+++ b/ACE/ace/ACE.cpp
@@ -254,9 +254,7 @@ int
ACE::process_active (pid_t pid)
{
#if !defined(ACE_WIN32)
- int retval = ACE_OS::kill (pid, 0);
-
- if (retval == 0)
+ if (ACE_OS::kill (pid, 0) == 0)
return 1;
else if (errno == ESRCH)
return 0;
@@ -266,8 +264,7 @@ ACE::process_active (pid_t pid)
// Create a handle for the given process id.
ACE_HANDLE process_handle =
::OpenProcess (PROCESS_QUERY_INFORMATION, FALSE, pid);
- if (process_handle == ACE_INVALID_HANDLE
- || process_handle == 0)
+ if (process_handle == ACE_INVALID_HANDLE || process_handle == 0)
return 0;
else
{
@@ -291,7 +288,7 @@ ACE::execname (const ACE_TCHAR *old_name)
const ACE_TCHAR *suffix = ACE_OS::strrchr (old_name, ACE_TEXT ('.'));
if (suffix == 0 || ACE_OS::strcasecmp (suffix, ACE_TEXT (".exe")) != 0)
{
- ACE_TCHAR *new_name;
+ ACE_TCHAR *new_name = 0;
size_t size =
ACE_OS::strlen (old_name)
diff --git a/ACE/ace/Hash_Map_Manager_T.cpp b/ACE/ace/Hash_Map_Manager_T.cpp
index 3119c109cd2..ad739593ed1 100644
--- a/ACE/ace/Hash_Map_Manager_T.cpp
+++ b/ACE/ace/Hash_Map_Manager_T.cpp
@@ -476,7 +476,7 @@ ACE_Hash_Map_Const_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_
// Handle initial case specially.
else if (this->index_ == -1)
{
- this->index_++;
+ ++this->index_;
return this->forward_i ();
}
else if (this->index_ >= (ssize_t) this->map_man_->total_size_)
diff --git a/ACE/ace/High_Res_Timer.h b/ACE/ace/High_Res_Timer.h
index 249d38078b9..4fa0b64c391 100644
--- a/ACE/ace/High_Res_Timer.h
+++ b/ACE/ace/High_Res_Timer.h
@@ -250,7 +250,7 @@ public:
static ACE_Time_Value gettimeofday (const ACE_OS::ACE_HRTimer_Op =
ACE_OS::ACE_HRTIMER_GETTIME);
- /// Converts an <hrt> to @a tv using global_scale_factor_.
+ /// Converts an @a hrt to @a tv using global_scale_factor_.
static void hrtime_to_tv (ACE_Time_Value &tv,
const ACE_hrtime_t hrt);
diff --git a/ACE/ace/High_Res_Timer.inl b/ACE/ace/High_Res_Timer.inl
index 2d089d1520c..90ae2e47630 100644
--- a/ACE/ace/High_Res_Timer.inl
+++ b/ACE/ace/High_Res_Timer.inl
@@ -53,8 +53,7 @@ ACE_High_Res_Timer::gettimeofday (const ACE_OS::ACE_HRTimer_Op op)
#endif /* ACE_WIN32 */
ACE_Time_Value tv;
- ACE_High_Res_Timer::hrtime_to_tv (tv,
- ACE_OS::gethrtime (op));
+ ACE_High_Res_Timer::hrtime_to_tv (tv, ACE_OS::gethrtime (op));
return tv;
}
diff --git a/ACE/ace/Reactor.h b/ACE/ace/Reactor.h
index 3f18f6517ad..405d2718a25 100644
--- a/ACE/ace/Reactor.h
+++ b/ACE/ace/Reactor.h
@@ -593,7 +593,7 @@ public:
* succeeded and 0 if the @a timer_id wasn't found.
*
* On successful cancellation, ACE_Event_Handler::handle_close()
- * will be called with <ACE_Event_Handler::TIMER_MASK>.
+ * will be called with ACE_Event_Handler::TIMER_MASK.
* ACE_Event_Handler::remove_reference() will also be called.
*/
virtual int cancel_timer (long timer_id,
@@ -607,7 +607,7 @@ public:
* multiple times for all timer associated with @a event_handler.
*
* ACE_Event_Handler::handle_close() will be called with
- * <ACE_Event_Handler::TIMER_MASK> only once irrespective of the
+ * ACE_Event_Handler::TIMER_MASK only once irrespective of the
* number of timers associated with the event handler.
* ACE_Event_Handler::remove_reference() will also be called once
* for every timer associated with the event handler.
diff --git a/ACE/ace/Select_Reactor_Base.h b/ACE/ace/Select_Reactor_Base.h
index bee67e0b38f..3dcc4c9051d 100644
--- a/ACE/ace/Select_Reactor_Base.h
+++ b/ACE/ace/Select_Reactor_Base.h
@@ -358,7 +358,7 @@ public:
// is within the range of legal handles (i.e., >= 0 && < max_size_).
bool invalid_handle (ACE_HANDLE handle);
- // Check the @c handle to make sure it's a valid @c ACE_HANDLE that
+ // Check the @a handle to make sure it's a valid @c ACE_HANDLE that
// within the range of currently registered handles (i.e., >= 0 && <
// @c max_handlep1_).
bool handle_in_range (ACE_HANDLE handle);
diff --git a/ACE/ace/Select_Reactor_Base.inl b/ACE/ace/Select_Reactor_Base.inl
index 178a8373291..6b283d38287 100644
--- a/ACE/ace/Select_Reactor_Base.inl
+++ b/ACE/ace/Select_Reactor_Base.inl
@@ -76,9 +76,9 @@ ACE_INLINE bool
ACE_Select_Reactor_Handler_Repository_Iterator::done (void) const
{
#ifdef ACE_WIN32
- return this->current_ != this->rep_->event_handlers_.end ();
+ return this->current_ == this->rep_->event_handlers_.end ();
#else
- return this->current_ != (this->rep_->event_handlers_.begin ()
+ return this->current_ == (this->rep_->event_handlers_.begin ()
+ this->rep_->max_handlep1 ());
#endif /* ACE_WIN32 */
}
diff --git a/ACE/ace/String_Base.cpp b/ACE/ace/String_Base.cpp
index 12850c9c29a..fef051a19ed 100644
--- a/ACE/ace/String_Base.cpp
+++ b/ACE/ace/String_Base.cpp
@@ -134,7 +134,7 @@ ACE_String_Base<CHAR>::set (const CHAR *s,
size_type new_buf_len = len + 1;
if (s != 0 && len != 0 && release && this->buf_len_ < new_buf_len)
{
- CHAR *temp;
+ CHAR *temp = 0;
ACE_ALLOCATOR (temp,
(CHAR *) this->allocator_->malloc (new_buf_len * sizeof (CHAR)));
diff --git a/ACE/ace/WFMO_Reactor.cpp b/ACE/ace/WFMO_Reactor.cpp
index 54c4221de02..42e69e69082 100644
--- a/ACE/ace/WFMO_Reactor.cpp
+++ b/ACE/ace/WFMO_Reactor.cpp
@@ -188,14 +188,13 @@ ACE_WFMO_Reactor_Handler_Repository::bit_ops (long &existing_masks,
int
ACE_WFMO_Reactor_Handler_Repository::unbind_i (ACE_HANDLE handle,
ACE_Reactor_Mask mask,
- int &changes_required)
+ bool &changes_required)
{
int error = 0;
// Remember this value; only if it changes do we need to wakeup
// the other threads
size_t const original_handle_count = this->handles_to_be_deleted_;
- int result = 0;
size_t i;
// Go through all the handles looking for <handle>. Even if we find
@@ -211,8 +210,7 @@ ACE_WFMO_Reactor_Handler_Repository::unbind_i (ACE_HANDLE handle,
&& // Make sure that it is not already marked for deleted
!this->current_info_[i].delete_entry_)
{
- result = this->remove_handler_i (i, mask);
- if (result == -1)
+ if (this->remove_handler_i (i, mask) == -1)
error = 1;
}
@@ -226,9 +224,7 @@ ACE_WFMO_Reactor_Handler_Repository::unbind_i (ACE_HANDLE handle,
// Make sure that it is not already marked for deleted
!this->current_suspended_info_[i].delete_entry_)
{
- result = this->remove_suspended_handler_i (i,
- mask);
- if (result == -1)
+ if (this->remove_suspended_handler_i (i, mask) == -1)
error = 1;
}
@@ -242,15 +238,14 @@ ACE_WFMO_Reactor_Handler_Repository::unbind_i (ACE_HANDLE handle,
// Make sure that it is not already marked for deleted
!this->to_be_added_info_[i].delete_entry_)
{
- result = this->remove_to_be_added_handler_i (i, mask);
- if (result == -1)
+ if (this->remove_to_be_added_handler_i (i, mask) == -1)
error = 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_deleted_)
- changes_required = 1;
+ changes_required = true;
return error ? -1 : 0;
}
@@ -290,7 +285,7 @@ ACE_WFMO_Reactor_Handler_Repository::remove_handler_i (size_t slot,
if (this->current_info_[slot].suspend_entry_)
{
// Undo suspension
- this->current_info_[slot].suspend_entry_ = 0;
+ this->current_info_[slot].suspend_entry_ = false;
// Decrement the handle count
--this->handles_to_be_suspended_;
}
@@ -358,7 +353,7 @@ ACE_WFMO_Reactor_Handler_Repository::remove_suspended_handler_i (size_t slot,
if (this->current_suspended_info_[slot].resume_entry_)
{
// Undo resumption
- this->current_suspended_info_[slot].resume_entry_ = 0;
+ this->current_suspended_info_[slot].resume_entry_ = false;
// Decrement the handle count
--this->handles_to_be_resumed_;
}
@@ -425,7 +420,7 @@ ACE_WFMO_Reactor_Handler_Repository::remove_to_be_added_handler_i (size_t slot,
if (this->to_be_added_info_[slot].suspend_entry_)
{
// Undo suspension
- this->to_be_added_info_[slot].suspend_entry_ = 0;
+ this->to_be_added_info_[slot].suspend_entry_ = false;
// Decrement the handle count
--this->handles_to_be_suspended_;
}
@@ -459,7 +454,7 @@ ACE_WFMO_Reactor_Handler_Repository::remove_to_be_added_handler_i (size_t slot,
int
ACE_WFMO_Reactor_Handler_Repository::suspend_handler_i (ACE_HANDLE handle,
- int &changes_required)
+ bool &changes_required)
{
size_t i = 0;
@@ -477,11 +472,11 @@ ACE_WFMO_Reactor_Handler_Repository::suspend_handler_i (ACE_HANDLE handle,
!this->current_info_[i].suspend_entry_)
{
// Mark to be suspended
- this->current_info_[i].suspend_entry_ = 1;
+ this->current_info_[i].suspend_entry_ = true;
// Increment the handle count
++this->handles_to_be_suspended_;
// Changes will be required
- changes_required = 1;
+ changes_required = true;
}
// Then check the suspended entries.
@@ -494,11 +489,11 @@ ACE_WFMO_Reactor_Handler_Repository::suspend_handler_i (ACE_HANDLE handle,
this->current_suspended_info_[i].resume_entry_)
{
// Undo resumption
- this->current_suspended_info_[i].resume_entry_ = 0;
+ this->current_suspended_info_[i].resume_entry_ = false;
// Decrement the handle count
--this->handles_to_be_resumed_;
// Changes will be required
- changes_required = 1;
+ changes_required = true;
}
// Then check the to_be_added entries.
@@ -511,11 +506,11 @@ ACE_WFMO_Reactor_Handler_Repository::suspend_handler_i (ACE_HANDLE handle,
!this->to_be_added_info_[i].suspend_entry_)
{
// Mark to be suspended
- this->to_be_added_info_[i].suspend_entry_ = 1;
+ this->to_be_added_info_[i].suspend_entry_ = true;
// Increment the handle count
++this->handles_to_be_suspended_;
// Changes will be required
- changes_required = 1;
+ changes_required = true;
}
return 0;
@@ -523,7 +518,7 @@ ACE_WFMO_Reactor_Handler_Repository::suspend_handler_i (ACE_HANDLE handle,
int
ACE_WFMO_Reactor_Handler_Repository::resume_handler_i (ACE_HANDLE handle,
- int &changes_required)
+ bool &changes_required)
{
size_t i = 0;
@@ -541,11 +536,11 @@ ACE_WFMO_Reactor_Handler_Repository::resume_handler_i (ACE_HANDLE handle,
this->current_info_[i].suspend_entry_)
{
// Undo suspension
- this->current_info_[i].suspend_entry_ = 0;
+ this->current_info_[i].suspend_entry_ = false;
// Decrement the handle count
--this->handles_to_be_suspended_;
// Changes will be required
- changes_required = 1;
+ changes_required = true;
}
// Then check the suspended entries.
@@ -558,11 +553,11 @@ ACE_WFMO_Reactor_Handler_Repository::resume_handler_i (ACE_HANDLE handle,
!this->current_suspended_info_[i].resume_entry_)
{
// Mark to be resumed
- this->current_suspended_info_[i].resume_entry_ = 1;
+ this->current_suspended_info_[i].resume_entry_ = true;
// Increment the handle count
++this->handles_to_be_resumed_;
// Changes will be required
- changes_required = 1;
+ changes_required = true;
}
// Then check the to_be_added entries.
@@ -575,11 +570,11 @@ ACE_WFMO_Reactor_Handler_Repository::resume_handler_i (ACE_HANDLE handle,
this->to_be_added_info_[i].suspend_entry_)
{
// Undo suspension
- this->to_be_added_info_[i].suspend_entry_ = 0;
+ this->to_be_added_info_[i].suspend_entry_ = false;
// Decrement the handle count
--this->handles_to_be_suspended_;
// Changes will be required
- changes_required = 1;
+ changes_required = true;
}
return 0;
@@ -591,7 +586,7 @@ ACE_WFMO_Reactor_Handler_Repository::unbind_all (void)
{
ACE_GUARD (ACE_Process_Mutex, ace_mon, this->wfmo_reactor_.lock_);
- int dummy;
+ bool dummy;
size_t i;
// Remove all the current handlers
@@ -611,7 +606,6 @@ ACE_WFMO_Reactor_Handler_Repository::unbind_all (void)
this->unbind_i (this->to_be_added_info_[i].event_handle_,
ACE_Event_Handler::ALL_EVENTS_MASK,
dummy);
-
}
// The guard is released here
@@ -622,7 +616,7 @@ ACE_WFMO_Reactor_Handler_Repository::unbind_all (void)
}
int
-ACE_WFMO_Reactor_Handler_Repository::bind_i (int io_entry,
+ACE_WFMO_Reactor_Handler_Repository::bind_i (bool io_entry,
ACE_Event_Handler *event_handler,
long network_events,
ACE_HANDLE io_handle,
diff --git a/ACE/ace/WFMO_Reactor.h b/ACE/ace/WFMO_Reactor.h
index da7ccdefe48..a791e5230a4 100644
--- a/ACE/ace/WFMO_Reactor.h
+++ b/ACE/ace/WFMO_Reactor.h
@@ -122,7 +122,7 @@ public:
public:
/// This indicates whether this entry is for I/O or for a regular
/// event
- int io_entry_;
+ bool io_entry_;
/// The assosiated <Event_Handler>
ACE_Event_Handler *event_handler_;
@@ -163,7 +163,7 @@ public:
void reset (void);
/// Set the structure to these new values
- void set (int io_entry,
+ void set (bool io_entry,
ACE_Event_Handler *event_handler,
ACE_HANDLE io_handle,
long network_events,
@@ -188,7 +188,7 @@ public:
{
public:
/// This is set when the entry needed to be suspended.
- int suspend_entry_;
+ bool suspend_entry_;
/// Default constructor
Current_Info (void);
@@ -197,18 +197,18 @@ public:
void reset (void);
/// Set the structure to these new values
- void set (int io_entry,
+ void set (bool io_entry,
ACE_Event_Handler *event_handler,
ACE_HANDLE io_handle,
long network_events,
bool delete_event,
bool delete_entry = false,
ACE_Reactor_Mask close_masks = ACE_Event_Handler::NULL_MASK,
- int suspend_entry = 0);
+ bool suspend_entry = false);
/// Set the structure to these new values
void set (Common_Info &common_info,
- int suspend_entry = 0);
+ bool suspend_entry = false);
/// Dump the state of an object.
void dump (ACE_HANDLE event_handle) const;
@@ -227,7 +227,7 @@ public:
ACE_HANDLE event_handle_;
/// This is set when the entry needed to be suspended.
- int suspend_entry_;
+ bool suspend_entry_;
/// Default constructor
To_Be_Added_Info (void);
@@ -237,19 +237,19 @@ public:
/// Set the structure to these new values
void set (ACE_HANDLE event_handle,
- int io_entry,
+ bool io_entry,
ACE_Event_Handler *event_handler,
ACE_HANDLE io_handle,
long network_events,
bool delete_event,
bool delete_entry = false,
ACE_Reactor_Mask close_masks = ACE_Event_Handler::NULL_MASK,
- int suspend_entry = 0);
+ bool suspend_entry = false);
/// Set the structure to these new values
void set (ACE_HANDLE event_handle,
Common_Info &common_info,
- int suspend_entry = 0);
+ bool suspend_entry = false);
/// Dump the state of an object.
void dump (void) const;
@@ -268,7 +268,7 @@ public:
ACE_HANDLE event_handle_;
/// This is set when the entry needed to be resumed.
- int resume_entry_;
+ bool resume_entry_;
/// Constructor used for initializing the structure
Suspended_Info (void);
@@ -278,19 +278,19 @@ public:
/// Set the structure to these new values
void set (ACE_HANDLE event_handle,
- int io_entry,
+ bool io_entry,
ACE_Event_Handler *event_handler,
ACE_HANDLE io_handle,
long network_events,
bool delete_event,
bool delete_entry = false,
ACE_Reactor_Mask close_masks = 0,
- int resume_entry = 0);
+ bool resume_entry = false);
/// Set the structure to these new values
void set (ACE_HANDLE event_handle,
Common_Info &common_info,
- int resume_entry = 0);
+ bool resume_entry = false);
/// Dump the state of an object.
void dump (void) const;
@@ -316,7 +316,7 @@ public:
/// Insert I/O <Event_Handler> entry into the system. This method
/// assumes that the lock are head *before* this method is invoked.
- int bind_i (int io_entry,
+ int bind_i (bool io_entry,
ACE_Event_Handler *event_handler,
long network_events,
ACE_HANDLE io_handle,
@@ -330,7 +330,7 @@ public:
/// Non-lock-grabbing version of <unbind>
int unbind_i (ACE_HANDLE,
ACE_Reactor_Mask mask,
- int &changes_required);
+ bool &changes_required);
/// Remove all bindings of <ACE_HANDLE, ACE_Event_Handler> tuples.
void unbind_all (void);
@@ -353,7 +353,7 @@ public:
Current_Info *current_info (void) const;
/// Check if changes to the handle set are required.
- virtual int changes_required (void);
+ virtual bool changes_required (void);
/// Make changes to the handle set
virtual int make_changes (void);
@@ -383,11 +383,11 @@ public:
/// Temporarily suspend entry
int suspend_handler_i (ACE_HANDLE handle,
- int &changes_required);
+ bool &changes_required);
/// Resume suspended entry
int resume_handler_i (ACE_HANDLE handle,
- int &changes_required);
+ bool &changes_required);
/// Deletions and suspensions in current_info_
int make_changes_in_current_infos (void);
@@ -1011,7 +1011,7 @@ public:
ACE_Reactor_Mask masks_to_be_added);
/**
- * Add @a masks_to_be_added to the <handle>'s entry in WFMO_Reactor.
+ * Add @a masks_to_be_added to the @a handle's entry in WFMO_Reactor.
* The Event_Handler associated with <handle> must already have been
* registered with WFMO_Reactor.
*/
diff --git a/ACE/ace/WFMO_Reactor.inl b/ACE/ace/WFMO_Reactor.inl
index 1b6b47c0f28..ff83ab84ece 100644
--- a/ACE/ace/WFMO_Reactor.inl
+++ b/ACE/ace/WFMO_Reactor.inl
@@ -29,7 +29,7 @@ ACE_Wakeup_All_Threads_Handler::handle_signal (int /* signum */,
ACE_INLINE
ACE_WFMO_Reactor_Handler_Repository::Common_Info::Common_Info (void)
- : io_entry_ (0),
+ : io_entry_ (false),
event_handler_ (0),
io_handle_ (ACE_INVALID_HANDLE),
network_events_ (0),
@@ -43,7 +43,7 @@ ACE_INLINE void
ACE_WFMO_Reactor_Handler_Repository::Common_Info::reset (void)
{
this->event_handler_ = 0;
- this->io_entry_ = 0;
+ this->io_entry_ = false;
this->io_handle_ = ACE_INVALID_HANDLE;
this->network_events_ = 0;
this->delete_event_ = false;
@@ -52,7 +52,7 @@ ACE_WFMO_Reactor_Handler_Repository::Common_Info::reset (void)
}
ACE_INLINE void
-ACE_WFMO_Reactor_Handler_Repository::Common_Info::set (int io_entry,
+ACE_WFMO_Reactor_Handler_Repository::Common_Info::set (bool io_entry,
ACE_Event_Handler *event_handler,
ACE_HANDLE io_handle,
long network_events,
@@ -119,19 +119,19 @@ ACE_WFMO_Reactor_Handler_Repository::Common_Info::dump (void) const
ACE_INLINE
ACE_WFMO_Reactor_Handler_Repository::Current_Info::Current_Info (void)
- : suspend_entry_ (0)
+ : suspend_entry_ (false)
{
}
ACE_INLINE void
-ACE_WFMO_Reactor_Handler_Repository::Current_Info::set (int io_entry,
+ACE_WFMO_Reactor_Handler_Repository::Current_Info::set (bool io_entry,
ACE_Event_Handler *event_handler,
ACE_HANDLE io_handle,
long network_events,
bool delete_event,
bool delete_entry,
ACE_Reactor_Mask close_masks,
- int suspend_entry)
+ bool suspend_entry)
{
this->suspend_entry_ = suspend_entry;
Common_Info::set (io_entry,
@@ -145,7 +145,7 @@ ACE_WFMO_Reactor_Handler_Repository::Current_Info::set (int io_entry,
ACE_INLINE void
ACE_WFMO_Reactor_Handler_Repository::Current_Info::set (Common_Info &common_info,
- int suspend_entry)
+ bool suspend_entry)
{
this->suspend_entry_ = suspend_entry;
Common_Info::set (common_info);
@@ -154,7 +154,7 @@ ACE_WFMO_Reactor_Handler_Repository::Current_Info::set (Common_Info &common_info
ACE_INLINE void
ACE_WFMO_Reactor_Handler_Repository::Current_Info::reset (void)
{
- this->suspend_entry_ = 0;
+ this->suspend_entry_ = false;
Common_Info::reset ();
}
@@ -187,20 +187,20 @@ ACE_WFMO_Reactor_Handler_Repository::Current_Info::dump (ACE_HANDLE event_handle
ACE_INLINE
ACE_WFMO_Reactor_Handler_Repository::To_Be_Added_Info::To_Be_Added_Info (void)
: event_handle_ (ACE_INVALID_HANDLE),
- suspend_entry_ (0)
+ suspend_entry_ (false)
{
}
ACE_INLINE void
ACE_WFMO_Reactor_Handler_Repository::To_Be_Added_Info::set (ACE_HANDLE event_handle,
- int io_entry,
+ bool io_entry,
ACE_Event_Handler *event_handler,
ACE_HANDLE io_handle,
long network_events,
bool delete_event,
bool delete_entry,
ACE_Reactor_Mask close_masks,
- int suspend_entry)
+ bool suspend_entry)
{
this->event_handle_ = event_handle;
this->suspend_entry_ = suspend_entry;
@@ -216,7 +216,7 @@ ACE_WFMO_Reactor_Handler_Repository::To_Be_Added_Info::set (ACE_HANDLE event_han
ACE_INLINE void
ACE_WFMO_Reactor_Handler_Repository::To_Be_Added_Info::set (ACE_HANDLE event_handle,
Common_Info &common_info,
- int suspend_entry)
+ bool suspend_entry)
{
this->event_handle_ = event_handle;
this->suspend_entry_ = suspend_entry;
@@ -227,7 +227,7 @@ ACE_INLINE void
ACE_WFMO_Reactor_Handler_Repository::To_Be_Added_Info::reset (void)
{
this->event_handle_ = ACE_INVALID_HANDLE;
- this->suspend_entry_ = 0;
+ this->suspend_entry_ = false;
Common_Info::reset ();
}
@@ -258,7 +258,7 @@ ACE_WFMO_Reactor_Handler_Repository::To_Be_Added_Info::dump (void) const
ACE_INLINE
ACE_WFMO_Reactor_Handler_Repository::Suspended_Info::Suspended_Info (void)
: event_handle_ (ACE_INVALID_HANDLE),
- resume_entry_ (0)
+ resume_entry_ (false)
{
}
@@ -266,20 +266,20 @@ ACE_INLINE void
ACE_WFMO_Reactor_Handler_Repository::Suspended_Info::reset (void)
{
this->event_handle_ = ACE_INVALID_HANDLE;
- this->resume_entry_ = 0;
+ this->resume_entry_ = false;
Common_Info::reset ();
}
ACE_INLINE void
ACE_WFMO_Reactor_Handler_Repository::Suspended_Info::set (ACE_HANDLE event_handle,
- int io_entry,
+ bool io_entry,
ACE_Event_Handler *event_handler,
ACE_HANDLE io_handle,
long network_events,
bool delete_event,
bool delete_entry,
ACE_Reactor_Mask close_masks,
- int resume_entry)
+ bool resume_entry)
{
this->event_handle_ = event_handle;
this->resume_entry_ = resume_entry;
@@ -295,7 +295,7 @@ ACE_WFMO_Reactor_Handler_Repository::Suspended_Info::set (ACE_HANDLE event_handl
ACE_INLINE void
ACE_WFMO_Reactor_Handler_Repository::Suspended_Info::set (ACE_HANDLE event_handle,
Common_Info &common_info,
- int resume_entry)
+ bool resume_entry)
{
this->event_handle_ = event_handle;
this->resume_entry_ = resume_entry;
@@ -392,7 +392,7 @@ ACE_WFMO_Reactor_Handler_Repository::invalid_handle (ACE_HANDLE handle) const
return 0;
}
-ACE_INLINE int
+ACE_INLINE bool
ACE_WFMO_Reactor_Handler_Repository::changes_required (void)
{
// Check if handles have be scheduled for additions or removal
@@ -432,7 +432,7 @@ ACE_WFMO_Reactor_Handler_Repository::unbind (ACE_HANDLE handle,
ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->wfmo_reactor_.lock_, -1);
- int changes_required = 0;
+ bool changes_required = false;
int const result = this->unbind_i (handle,
mask,
changes_required);
@@ -663,7 +663,7 @@ ACE_WFMO_Reactor::remove_handler (const ACE_Handle_Set &handles,
{
ACE_Handle_Set_Iterator handle_iter (handles);
ACE_HANDLE h;
- int changes_required = 0;
+ bool changes_required = false;
ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->lock_, -1);
@@ -685,7 +685,7 @@ ACE_WFMO_Reactor::suspend_handler (ACE_HANDLE handle)
{
ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->lock_, -1);
- int changes_required = 0;
+ bool changes_required = false;
int const result =
this->handler_rep_.suspend_handler_i (handle,
changes_required);
@@ -709,7 +709,7 @@ ACE_WFMO_Reactor::suspend_handler (const ACE_Handle_Set &handles)
{
ACE_Handle_Set_Iterator handle_iter (handles);
ACE_HANDLE h;
- int changes_required = 0;
+ bool changes_required = false;
ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->lock_, -1);
@@ -728,30 +728,44 @@ ACE_WFMO_Reactor::suspend_handler (const ACE_Handle_Set &handles)
ACE_INLINE int
ACE_WFMO_Reactor::suspend_handlers (void)
{
- int error = 0;
+ bool error = false;
int result = 0;
ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->lock_, -1);
// First suspend all current handles
- int changes_required = 0;
+ bool changes_required = false;
for (size_t i = 0;
- i < this->handler_rep_.max_handlep1_ && error == 0;
+ i < this->handler_rep_.max_handlep1_ && !error;
i++)
{
result =
this->handler_rep_.suspend_handler_i (this->handler_rep_.current_handles_[i],
changes_required);
if (result == -1)
- error = 1;
+ error = true;
}
- if (!error)
- // Then suspend all to_be_added_handles
- for (size_t i = 0;
- i < this->handler_rep_.handles_to_be_added_;
- i++)
- this->handler_rep_.to_be_added_info_[i].suspend_entry_ = 1;
+ // Then suspend all to_be_added_handles
+ for (size_t i = 0;
+ i < this->handler_rep_.handles_to_be_added_ && !error;
+ i++)
+ {
+ if (this->handler_rep_.to_be_added_info_[i].io_entry_)
+ {
+ result =
+ this->handler_rep_.suspend_handler_i (this->handler_rep_.to_be_added_info_[i].io_handle_,
+ changes_required);
+ }
+ else
+ {
+ result =
+ this->handler_rep_.suspend_handler_i (this->handler_rep_.to_be_added_info_[i].event_handle_,
+ changes_required);
+ }
+ if (result == -1)
+ error = true;
+ }
// Wake up all threads in WaitForMultipleObjects so that they can
// reconsult the handle set
@@ -765,10 +779,9 @@ ACE_WFMO_Reactor::resume_handler (ACE_HANDLE handle)
{
ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->lock_, -1);
- int changes_required = 0;
+ bool changes_required = false;
int result =
- this->handler_rep_.resume_handler_i (handle,
- changes_required);
+ this->handler_rep_.resume_handler_i (handle, changes_required);
if (changes_required)
// Wake up all threads in WaitForMultipleObjects so that they can
@@ -789,7 +802,7 @@ ACE_WFMO_Reactor::resume_handler (const ACE_Handle_Set &handles)
{
ACE_Handle_Set_Iterator handle_iter (handles);
ACE_HANDLE h;
- int changes_required = 0;
+ bool changes_required = false;
ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->lock_, -1);
@@ -808,28 +821,42 @@ ACE_WFMO_Reactor::resume_handler (const ACE_Handle_Set &handles)
ACE_INLINE int
ACE_WFMO_Reactor::resume_handlers (void)
{
- int error = 0;
+ bool error = false;
int result = 0;
ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->lock_, -1);
- int changes_required = 0;
+ bool changes_required = false;
for (size_t i = 0;
- i < this->handler_rep_.suspended_handles_ && error == 0;
+ i < this->handler_rep_.suspended_handles_ && !error;
i++)
{
result =
this->handler_rep_.resume_handler_i (this->handler_rep_.current_suspended_info_[i].event_handle_,
changes_required);
if (result == -1)
- error = 1;
+ error = true;
}
- if (!error)
- // Then resume all to_be_added_handles
- for (size_t i = 0;
- i < this->handler_rep_.handles_to_be_added_;
- i++)
- this->handler_rep_.to_be_added_info_[i].suspend_entry_ = 0;
+ // Then resume all to_be_added_handles
+ for (size_t i = 0;
+ i < this->handler_rep_.handles_to_be_added_ && !error;
+ i++)
+ {
+ if (this->handler_rep_.to_be_added_info_[i].io_entry_)
+ {
+ result =
+ this->handler_rep_.resume_handler_i (this->handler_rep_.to_be_added_info_[i].io_handle_,
+ changes_required);
+ }
+ else
+ {
+ result =
+ this->handler_rep_.resume_handler_i (this->handler_rep_.to_be_added_info_[i].event_handle_,
+ changes_required);
+ }
+ if (result == -1)
+ error = true;
+ }
// Wake up all threads in WaitForMultipleObjects so that they can
// reconsult the handle set
@@ -1151,10 +1178,10 @@ ACE_WFMO_Reactor::size (void) const
return this->handler_rep_.max_size_ - 2;
}
#else
-ACE_INLINE int
+ACE_INLINE bool
ACE_WFMO_Reactor_Handler_Repository::changes_required (void)
{
- return 0;
+ return false;
}
ACE_INLINE int
diff --git a/ACE/bin/tao_orb_tests.lst b/ACE/bin/tao_orb_tests.lst
index 473aed5f17f..c2fd1f5bf2d 100644
--- a/ACE/bin/tao_orb_tests.lst
+++ b/ACE/bin/tao_orb_tests.lst
@@ -120,6 +120,7 @@ TAO/tests/Bug_3163_Regression/run_test.pl: !LabVIEW_RT
TAO/tests/Bug_3171_Regression/run_test.pl: !ST !MINIMUM !NO_MESSAGING !LabVIEW_RT
TAO/tests/Bug_3198_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT
TAO/tests/Bug_3251_Regression/run_test.pl: !ST !LabVIEW_RT !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !STATIC
+TAO/tests/Bug_3276_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT
TAO/tests/DIOP/run_test.pl: !ST !NO_DIOP !ACE_FOR_TAO !CORBA_E_MICRO !LabVIEW_RT
TAO/tests/DIOP/run_test_ipv6.pl: IPV6 !ST !NO_DIOP !ACE_FOR_TAO !CORBA_E_MICRO !LabVIEW_RT
TAO/tests/RTCORBA/Activate_Object_Multiple_ORBs/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !LabVIEW_RT
diff --git a/ACE/tests/Reactor_Dispatch_Order_Test.cpp b/ACE/tests/Reactor_Dispatch_Order_Test.cpp
index 6c700ffb043..10d68a4f402 100644
--- a/ACE/tests/Reactor_Dispatch_Order_Test.cpp
+++ b/ACE/tests/Reactor_Dispatch_Order_Test.cpp
@@ -22,6 +22,7 @@
#include "ace/Reactor.h"
#include "ace/Select_Reactor.h"
#include "ace/WFMO_Reactor.h"
+#include "ace/Dev_Poll_Reactor.h"
#include "ace/Pipe.h"
#include "ace/ACE.h"
@@ -44,6 +45,8 @@ public:
int handle_output (ACE_HANDLE fd);
+ ACE_HANDLE get_handle (void) const;
+
// We need to add MSG_OOB data transfer to this test to check the
// order of when <handle_exception> gets called. I tried with
// Windows 2000 but only one byte of the message came across as
@@ -82,11 +85,19 @@ Handler::Handler (ACE_Reactor &reactor)
}
}
+
Handler::~Handler (void)
{
this->pipe_.close ();
}
+
+ACE_HANDLE
+Handler::get_handle (void) const
+{
+ return this->pipe_.read_handle ();
+}
+
int
Handler::handle_timeout (const ACE_Time_Value &,
const void *)
@@ -153,14 +164,14 @@ Handler::handle_input (ACE_HANDLE fd)
return 0;
}
-static void
+static bool
test_reactor_dispatch_order (ACE_Reactor &reactor)
{
Handler handler (reactor);
if (!handler.ok_)
{
ACE_ERROR ((LM_ERROR, ACE_TEXT ("Error initializing test; abort.\n")));
- return;
+ return false;
}
bool ok_to_go = true;
@@ -186,8 +197,37 @@ test_reactor_dispatch_order (ACE_Reactor &reactor)
ok_to_go = false;
}
+ // Suspend the handlers - only the timer should be dispatched
+ ACE_Time_Value tv (1);
+ reactor.suspend_handlers ();
+ reactor.run_reactor_event_loop (tv);
+
+ // only the timer should have fired
+ if (handler.dispatch_order_ != 2)
+ {
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("Incorrect number fired %d\n"),
+ handler.dispatch_order_));
+ ok_to_go = false;
+ }
+
+ // Reset the dispatch_order_ count and schedule another timer
+ handler.dispatch_order_ = 1;
+ if (-1 == reactor.schedule_timer (&handler,
+ 0,
+ ACE_Time_Value (0)))
+ {
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("schedule_timer")));
+ ok_to_go = false;
+ }
+
+ // Resume the handlers - things should work now
+ reactor.resume_handlers ();
+
if (ok_to_go)
- reactor.run_reactor_event_loop ();
+ {
+ reactor.run_reactor_event_loop (tv);
+ reactor.run_reactor_event_loop (tv);
+ }
if (0 != reactor.remove_handler (handler.pipe_.read_handle (),
ACE_Event_Handler::ALL_EVENTS_MASK |
@@ -195,6 +235,15 @@ test_reactor_dispatch_order (ACE_Reactor &reactor)
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("%p\n"),
ACE_TEXT ("remover_handler pipe")));
+
+ if (handler.dispatch_order_ != 4)
+ {
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("Incorrect number fired %d\n"),
+ handler.dispatch_order_));
+ ok_to_go = false;
+ }
+
+ return ok_to_go;
}
int
@@ -202,10 +251,12 @@ run_main (int, ACE_TCHAR *[])
{
ACE_START_TEST (ACE_TEXT ("Reactor_Dispatch_Order_Test"));
+ int result = 0;
ACE_Select_Reactor select_reactor_impl;
ACE_Reactor select_reactor (&select_reactor_impl);
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Testing ACE_Select_Reactor\n")));
- test_reactor_dispatch_order (select_reactor);
+ if (!test_reactor_dispatch_order (select_reactor))
+ ++result;
// Winsock 2 things are needed for WFMO_Reactor.
#if defined (ACE_WIN32) && \
@@ -214,10 +265,20 @@ run_main (int, ACE_TCHAR *[])
ACE_WFMO_Reactor wfmo_reactor_impl;
ACE_Reactor wfmo_reactor (&wfmo_reactor_impl);
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Testing ACE_WFMO_Reactor\n")));
- test_reactor_dispatch_order (wfmo_reactor);
+ if (!test_reactor_dispatch_order (wfmo_reactor))
+ ++result;
#endif /* ACE_WIN32 && ACE_HAS_WINSOCK2 */
+#if defined (ACE_HAS_EVENT_POLL)
+ ACE_Dev_Poll_Reactor dev_poll_reactor_impl;
+ ACE_Reactor dev_poll_reactor (&dev_poll_reactor_impl);
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Testing Dev Poll Reactor\n")));
+ if (!test_reactor_dispatch_order (dev_poll_reactor))
+ ++result;
+#endif /* ACE_HAS_EVENT_POLL */
+
+
ACE_END_TEST;
return 0;
}
diff --git a/ACE/tests/unload_libace.mpb b/ACE/tests/unload_libace.mpb
index bbc90e9a707..2893a31633e 100644
--- a/ACE/tests/unload_libace.mpb
+++ b/ACE/tests/unload_libace.mpb
@@ -4,11 +4,5 @@
feature(ace_for_tao) {
macros += ACE_LIB_NAME=\\"ACE_FOR_TAO\\"
}
-project {
- specific(vc8, nmake) {
- macros += _CRT_SECURE_NO_WARNINGS
- }
- specific(nmake) {
- compile_flags += /wd4996
- }
+project: vc_warnings {
}