summaryrefslogtreecommitdiff
path: root/ACE
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>2010-02-22 14:48:31 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>2010-02-22 14:48:31 +0000
commit3c8147a0a47675a75f3dec7beca6dceef3379162 (patch)
treecb6debbcc2c8a71b467ecf687b71b3f154e29f46 /ACE
parent64e8332f75090ad77a47d13e9ae457232b8749eb (diff)
downloadATCD-3c8147a0a47675a75f3dec7beca6dceef3379162.tar.gz
ChangeLogTag:Mon
Diffstat (limited to 'ACE')
-rw-r--r--ACE/ChangeLog16
-rw-r--r--ACE/ace/Condition_T.cpp6
-rw-r--r--ACE/ace/Recursive_Thread_Mutex.h3
-rw-r--r--ACE/ace/Recursive_Thread_Mutex.inl2
-rw-r--r--ACE/ace/Thread_Mutex.h2
-rw-r--r--ACE/ace/Time_Value.cpp56
-rw-r--r--ACE/ace/Time_Value.h2
-rw-r--r--ACE/tests/Recursive_Condition_Test.cpp4
8 files changed, 46 insertions, 45 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index f91c982cbd8..a1706d8b3dd 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,19 @@
+Mon Feb 22 14:46:53 UTC 2010 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu>
+
+ * ace/Time_Value.{h,cpp} (ACE_Time_Value::normalize):
+ Reformatted/renamed the code to conform to ACE programming
+ guidelines.
+
+Mon Feb 22 13:40:14 UTC 2010 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu>
+
+ * ace/Condition_T.cpp: Changed the mutex() accessor to lock() to
+ be consistent.
+
+Mon Feb 22 13:39:09 UTC 2010 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu>
+
+ * ace/Recursive_Thread_Mutex.{h,inl}: Created a new lock() accessor
+ so it's consistent with the other synchronizer accessors in ACE.
+
Sun Feb 21 21:25:21 UTC 2010 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu>
* tests/Time_Value_Test.cpp: Added a test for the new operator<<
diff --git a/ACE/ace/Condition_T.cpp b/ACE/ace/Condition_T.cpp
index 7c97ac77765..4c051cbd336 100644
--- a/ACE/ace/Condition_T.cpp
+++ b/ACE/ace/Condition_T.cpp
@@ -87,7 +87,7 @@ ACE_Condition<MUTEX>::wait (void)
{
// ACE_TRACE ("ACE_Condition<MUTEX>::wait");
return ACE_OS::cond_wait (&this->cond_,
- &this->mutex_.mutex ());
+ &this->mutex_.lock ());
}
template <class MUTEX> int
@@ -97,12 +97,12 @@ ACE_Condition<MUTEX>::wait (MUTEX &mutex,
// ACE_TRACE ("ACE_Condition<MUTEX>::wait");
if (abstime == 0)
return ACE_OS::cond_wait (&this->cond_,
- &mutex.mutex ());
+ &mutex.lock ());
else
{
ACE_Time_Value tv = *abstime;
return ACE_OS::cond_timedwait (&this->cond_,
- &mutex.mutex (),
+ &mutex.lock (),
&tv);
}
}
diff --git a/ACE/ace/Recursive_Thread_Mutex.h b/ACE/ace/Recursive_Thread_Mutex.h
index 38effc66afb..65807b64b47 100644
--- a/ACE/ace/Recursive_Thread_Mutex.h
+++ b/ACE/ace/Recursive_Thread_Mutex.h
@@ -151,6 +151,9 @@ public:
int get_nesting_level (void);
/// Returns a reference to the recursive mutex;
+ ACE_recursive_thread_mutex_t &lock (void);
+
+ /// @deprecated Returns a reference to the recursive mutex;
ACE_recursive_thread_mutex_t &mutex (void);
/// Returns a reference to the recursive mutex's internal mutex;
diff --git a/ACE/ace/Recursive_Thread_Mutex.inl b/ACE/ace/Recursive_Thread_Mutex.inl
index 0269de24d6b..6a7b55dc6a2 100644
--- a/ACE/ace/Recursive_Thread_Mutex.inl
+++ b/ACE/ace/Recursive_Thread_Mutex.inl
@@ -5,7 +5,7 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_INLINE ACE_recursive_thread_mutex_t &
-ACE_Recursive_Thread_Mutex::mutex (void)
+ACE_Recursive_Thread_Mutex::lock (void)
{
return lock_;
}
diff --git a/ACE/ace/Thread_Mutex.h b/ACE/ace/Thread_Mutex.h
index d8f5369b01a..84fbb85a94a 100644
--- a/ACE/ace/Thread_Mutex.h
+++ b/ACE/ace/Thread_Mutex.h
@@ -146,7 +146,7 @@ public:
/// Declare the dynamic allocation hooks.
ACE_ALLOC_HOOK_DECLARE;
- // protected:
+protected:
/// Mutex type that supports single-process locking efficiently.
ACE_thread_mutex_t lock_;
diff --git a/ACE/ace/Time_Value.cpp b/ACE/ace/Time_Value.cpp
index a5bcb046266..ffd533e2c05 100644
--- a/ACE/ace/Time_Value.cpp
+++ b/ACE/ace/Time_Value.cpp
@@ -168,7 +168,7 @@ ACE_Time_Value::dump (void) const
}
void
-ACE_Time_Value::normalize (bool bSaturate)
+ACE_Time_Value::normalize (bool saturate)
{
// // ACE_OS_TRACE ("ACE_Time_Value::normalize");
// From Hans Rohnert...
@@ -177,61 +177,45 @@ ACE_Time_Value::normalize (bool bSaturate)
{
/*! \todo This loop needs some optimization.
*/
- if (!bSaturate) // keep the conditionnal expression outside the while loop to minimize performance cost
- {
+ if (!saturate) // keep the conditionnal expression outside the while loop to minimize performance cost
do
- {
- ++this->tv_.tv_sec;
- this->tv_.tv_usec -= ACE_ONE_SECOND_IN_USECS;
- }
- while (this->tv_.tv_usec >= ACE_ONE_SECOND_IN_USECS);
- }
- else
- {
- do
- {
- if (this->tv_.tv_sec < ACE_Numeric_Limits<time_t>::max())
{
++this->tv_.tv_sec;
this->tv_.tv_usec -= ACE_ONE_SECOND_IN_USECS;
}
+ while (this->tv_.tv_usec >= ACE_ONE_SECOND_IN_USECS);
+ else
+ do
+ if (this->tv_.tv_sec < ACE_Numeric_Limits<time_t>::max())
+ {
+ ++this->tv_.tv_sec;
+ this->tv_.tv_usec -= ACE_ONE_SECOND_IN_USECS;
+ }
else
- {
this->tv_.tv_usec = ACE_ONE_SECOND_IN_USECS - 1;
- }
- }
while (this->tv_.tv_usec >= ACE_ONE_SECOND_IN_USECS);
- }
}
else if (this->tv_.tv_usec <= -ACE_ONE_SECOND_IN_USECS)
{
/*! \todo This loop needs some optimization.
*/
- if (!bSaturate)
- {
+ if (!saturate)
do
- {
- --this->tv_.tv_sec;
- this->tv_.tv_usec += ACE_ONE_SECOND_IN_USECS;
- }
- while (this->tv_.tv_usec <= -ACE_ONE_SECOND_IN_USECS);
- }
- else
- {
- do
- {
- if (this->tv_.tv_sec > ACE_Numeric_Limits<time_t>::min())
{
--this->tv_.tv_sec;
this->tv_.tv_usec += ACE_ONE_SECOND_IN_USECS;
}
+ while (this->tv_.tv_usec <= -ACE_ONE_SECOND_IN_USECS);
+ else
+ do
+ if (this->tv_.tv_sec > ACE_Numeric_Limits<time_t>::min())
+ {
+ --this->tv_.tv_sec;
+ this->tv_.tv_usec += ACE_ONE_SECOND_IN_USECS;
+ }
else
- {
this->tv_.tv_usec = -ACE_ONE_SECOND_IN_USECS + 1;
- }
- }
while (this->tv_.tv_usec <= -ACE_ONE_SECOND_IN_USECS);
- }
}
if (this->tv_.tv_sec >= 1 && this->tv_.tv_usec < 0)
@@ -239,7 +223,7 @@ ACE_Time_Value::normalize (bool bSaturate)
--this->tv_.tv_sec;
this->tv_.tv_usec += ACE_ONE_SECOND_IN_USECS;
}
-// tv_sec in qnxnto is unsigned
+ // tv_sec in qnxnto is unsigned
#if !defined ( __QNXNTO__)
else if (this->tv_.tv_sec < 0 && this->tv_.tv_usec > 0)
{
diff --git a/ACE/ace/Time_Value.h b/ACE/ace/Time_Value.h
index dcebf22ca74..5943094ef75 100644
--- a/ACE/ace/Time_Value.h
+++ b/ACE/ace/Time_Value.h
@@ -327,7 +327,7 @@ public:
private:
/// Put the timevalue into a canonical form.
- void normalize (bool bSaturate = false);
+ void normalize (bool saturate = false);
/// Store the values as a timeval.
#if defined (ACE_HAS_TIME_T_LONG_MISMATCH)
diff --git a/ACE/tests/Recursive_Condition_Test.cpp b/ACE/tests/Recursive_Condition_Test.cpp
index e0e97c2b33c..63360905348 100644
--- a/ACE/tests/Recursive_Condition_Test.cpp
+++ b/ACE/tests/Recursive_Condition_Test.cpp
@@ -11,8 +11,7 @@
// = DESCRIPTION
// This test program validates the functionality of the
// ACE_Condition<ACE_Recursive_Thread_Mutex> template
-// specialization when combined with the
-// ACE_Thread_Timer_Queue_Adapter on Win32 and Posix pthreads.
+// specialization.
//
// = AUTHOR
// Stephen Howard <stephen.e.howard@lmco.com> and
@@ -248,7 +247,6 @@ run_main (int, ACE_TCHAR *[])
ACE_START_TEST (ACE_TEXT ("Recursive_Condition_Test"));
#if defined (ACE_HAS_THREADS)
-
int status = 0;
/* Test 1 - Simple test */