summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.cpp')
-rw-r--r--TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.cpp44
1 files changed, 12 insertions, 32 deletions
diff --git a/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.cpp b/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.cpp
index b7fa81697e3..9398bba6049 100644
--- a/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.cpp
+++ b/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.cpp
@@ -28,7 +28,7 @@ CosSchedulingLockList::CosSchedulingLockList(CosSchedulingLockNode *lock_array,
const int size,
ACE_SYNCH_MUTEX *mutex)
{
- ACE_TRY_NEW_ENV
+ try
{
/*
* The pointers to the beginnings of the lists must be globally visible,
@@ -55,7 +55,6 @@ CosSchedulingLockList::CosSchedulingLockList(CosSchedulingLockNode *lock_array,
ACE_SYNCH_CONDITION(*mutex),
CORBA::NO_MEMORY());
}
- ACE_TRY_CHECK;
lock_array[size - 1].next(0); /// terminate the free list
@@ -64,16 +63,14 @@ CosSchedulingLockList::CosSchedulingLockList(CosSchedulingLockNode *lock_array,
this->granted_ = &lock_array[1];
this->pending_ = &lock_array[2];
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
ACE_DEBUG((LM_ERROR,
"Error in %s: Line %d - Could not generate a Locklist in shared memory\n",
__FILE__,
__LINE__));
- ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION,
- "Exception: CosSchedulingLockList()");
+ ex._tao_print_exception ("Exception: CosSchedulingLockList()");
}
- ACE_ENDTRY;
}
void
@@ -255,7 +252,7 @@ PCP_Manager::PCP_Manager(CosSchedulingLockList *locks,
void
PCP_Manager::lock(const int priority_ceiling, const int priority)
{
- ACE_TRY_NEW_ENV
+ try
{
/// we do not want the thread to be pre-empted inside
@@ -265,7 +262,6 @@ PCP_Manager::lock(const int priority_ceiling, const int priority)
// at RTCORBA::maxPriority
this->current_->the_priority(RTCORBA::maxPriority);
this->mutex_->acquire();
- ACE_TRY_CHECK;
/// create a structure to store my own lock request
CosSchedulingLockNode MyLock;
@@ -322,35 +318,30 @@ PCP_Manager::lock(const int priority_ceiling, const int priority)
ACE_ERROR((LM_ERROR,
"Error in deferring lock\n"));
}
- ACE_TRY_CHECK;
}
}
/// remove mutex on the lock list
this->mutex_->release();
- ACE_TRY_CHECK;
/// at this point we have the right to set the OS priority
/// Do so at the priority ceiline.
this->current_->the_priority(priority_ceiling);
- ACE_TRY_CHECK;
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
ACE_DEBUG((LM_ERROR,
"Error in %s: Line %d - Could lock resource\n"
__FILE__,
__LINE__));
- ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION,
- "Exception: PCP_Manager::lock");
+ ex._tao_print_exception ("Exception: PCP_Manager::lock");
}
- ACE_ENDTRY;
}
void PCP_Manager::release_lock()
{
- ACE_TRY_NEW_ENV
+ try
{
/// To prevent pre-emption in the critical section,
/// which could lead to unbounded blocking
@@ -358,7 +349,6 @@ void PCP_Manager::release_lock()
/// set up the mutex
this->mutex_->acquire();
- ACE_TRY_CHECK;
/// remove the lock node from the list of locks
CosSchedulingLockNode L;
@@ -367,7 +357,6 @@ void PCP_Manager::release_lock()
/// Done with the list, release the mutex
this->mutex_->release();
- ACE_TRY_CHECK;
/// Let the highest priority lock signal the condition variable
CosSchedulingLockNode *waiter = this->locks_->highest_priority();
@@ -375,27 +364,24 @@ void PCP_Manager::release_lock()
{
waiter->condition_->signal();
}
- ACE_TRY_CHECK;
/// We do not need to restore priority because we have already set this
// thread to wait at RTCORBA::maxPriority at the start of this method
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
ACE_DEBUG((LM_ERROR,
"Error in %s: Line %d - Could not release lock\n"
__FILE__,
__LINE__));
- ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION,
- "Exception: PCP_Manager::release_lock");
+ ex._tao_print_exception ("Exception: PCP_Manager::release_lock");
}
- ACE_ENDTRY;
}
PCP_Manager_Factory::PCP_Manager_Factory(const char *shared_file)
{
- ACE_TRY_NEW_ENV
+ try
{
#if !defined (ACE_LACKS_MMAP)
char temp_file[MAXPATHLEN + 1];
@@ -411,7 +397,6 @@ PCP_Manager_Factory::PCP_Manager_Factory(const char *shared_file)
__LINE__));
ACE_OS::exit(1);
}
- ACE_TRY_CHECK;
/// Add the filename to the end
ACE_OS_String::strcat (temp_file, shared_file);
@@ -433,7 +418,6 @@ PCP_Manager_Factory::PCP_Manager_Factory(const char *shared_file)
ACE_ERROR ((LM_ERROR,
"(%P|%t) %p\n",
this->shm_key_));
- ACE_TRY_CHECK;
#else /* !ACE_LACKS_MMAP */
ACE_DEBUG((LM_ERROR,
@@ -464,7 +448,6 @@ PCP_Manager_Factory::PCP_Manager_Factory(const char *shared_file)
ACE_OS::exit(1);
}
- ACE_CHECK;
/// Make the shared memory a place for a lock list
this->lock_array_ = static_cast<CosSchedulingLockNode *> (this->mem_.malloc(CosSchedulingLockList_space));
@@ -489,20 +472,17 @@ PCP_Manager_Factory::PCP_Manager_Factory(const char *shared_file)
&this->mutex_),
CORBA::NO_MEMORY()
);
- ACE_TRY_CHECK;
}
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
ACE_ERROR((LM_ERROR,
"Error in %s: Line %d - Error in creating "
"PCP_Manager_Factory to create new PCP_Managers\n"
__FILE__,
__LINE__));
- ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION,
- "PCP_Manager_Factory::PCP_Manager_Factory\n");
+ ex._tao_print_exception ("PCP_Manager_Factory::PCP_Manager_Factory\n");
}
- ACE_ENDTRY;
}
PCP_Manager_Factory::~PCP_Manager_Factory()