TAO_Named_RT_Mutex_Manager Class Reference

Manages the names of named and unnamed RT Mutexes. More...

#include <RT_ORB.h>

List of all members.

Public Member Functions

 TAO_Named_RT_Mutex_Manager (void)
 Constructor.
 ~TAO_Named_RT_Mutex_Manager (void)
 Destructor.
RTCORBA::Mutex_ptr create_mutex (void)
void destroy_mutex (RTCORBA::Mutex_ptr the_mutex)
RTCORBA::Mutex_ptr create_named_mutex (const char *name, CORBA::Boolean_out created_flag)
RTCORBA::Mutex_ptr open_named_mutex (const char *name)


Detailed Description

Manages the names of named and unnamed RT Mutexes.

Definition at line 50 of file RT_ORB.h.


Constructor & Destructor Documentation

TAO_Named_RT_Mutex_Manager::TAO_Named_RT_Mutex_Manager ( void   ) 

Constructor.

Definition at line 77 of file RT_ORB.cpp.

00078 {
00079 }

TAO_Named_RT_Mutex_Manager::~TAO_Named_RT_Mutex_Manager ( void   ) 

Destructor.

Definition at line 81 of file RT_ORB.cpp.

00082 {
00083 }


Member Function Documentation

RTCORBA::Mutex_ptr TAO_Named_RT_Mutex_Manager::create_mutex ( void   ) 

Definition at line 86 of file RT_ORB.cpp.

References CORBA::SystemException::_tao_minor_code(), ACE_NEW_THROW_EX, CORBA::COMPLETED_NO, and TAO::VMCID.

Referenced by TAO_RT_ORB::create_mutex().

00087 {
00088   TAO_RT_Mutex *mutex = 0;
00089   ACE_NEW_THROW_EX (mutex,
00090                     TAO_RT_Mutex (),
00091                     CORBA::NO_MEMORY (
00092                       CORBA::SystemException::_tao_minor_code (
00093                         TAO::VMCID,
00094                         ENOMEM),
00095                       CORBA::COMPLETED_NO));
00096 
00097   return mutex;
00098 }

RTCORBA::Mutex_ptr TAO_Named_RT_Mutex_Manager::create_named_mutex ( const char *  name,
CORBA::Boolean_out  created_flag 
)

Definition at line 135 of file RT_ORB.cpp.

References CORBA::SystemException::_tao_minor_code(), ACE_GUARD_THROW_EX, ACE_NEW_THROW_EX, CORBA::COMPLETED_NO, TAO_SYNCH_MUTEX, and TAO::VMCID.

Referenced by TAO_RT_ORB::create_named_mutex().

00137 {
00138 #if (TAO_HAS_NAMED_RT_MUTEXES == 1)
00139   // The following should be atomic.
00140   ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX,
00141                       monitor,
00142                       this->lock_,
00143                       CORBA::INTERNAL ());
00144 
00145   // Optimistic that we'll find it.
00146   created_flag = false;
00147 
00148   // If we find the mutex, simply return it.
00149   RTCORBA::Mutex_var mutex;
00150   if (this->map_.find (name, mutex) != 0)
00151     {
00152       // Oops, we didn't find it.
00153       created_flag = true;
00154 
00155       RTCORBA::Mutex_ptr tmp_mutex;
00156 
00157       // Create a new one.
00158       ACE_NEW_THROW_EX (tmp_mutex,
00159                         TAO_Named_RT_Mutex (name),
00160                         CORBA::NO_MEMORY (
00161                           CORBA::SystemException::_tao_minor_code (
00162                             TAO::VMCID,
00163                             ENOMEM),
00164                           CORBA::COMPLETED_NO));
00165 
00166       mutex = tmp_mutex;
00167 
00168       // Add it to the map.
00169       int const result = this->map_.bind (name, mutex);
00170 
00171       if (result != 0)
00172         throw ::CORBA::INTERNAL ();
00173     }
00174 
00175   // Return the one we found or created.
00176   return mutex._retn ();
00177 #else /* TAO_HAS_NAMED_RT_MUTEXES */
00178   ACE_UNUSED_ARG (name);
00179   ACE_UNUSED_ARG (created_flag);
00180   throw ::CORBA::NO_IMPLEMENT ();
00181 #endif /* TAO_HAS_NAMED_RT_MUTEXES */
00182 }

void TAO_Named_RT_Mutex_Manager::destroy_mutex ( RTCORBA::Mutex_ptr  the_mutex  ) 

Definition at line 129 of file RT_ORB.cpp.

Referenced by TAO_RT_ORB::destroy_mutex().

00130 {
00131 }

RTCORBA::Mutex_ptr TAO_Named_RT_Mutex_Manager::open_named_mutex ( const char *  name  ) 

Definition at line 185 of file RT_ORB.cpp.

References ACE_GUARD_THROW_EX, and TAO_SYNCH_MUTEX.

Referenced by TAO_RT_ORB::open_named_mutex().

00186 {
00187 #if (TAO_HAS_NAMED_RT_MUTEXES == 1)
00188   // The following should be atomic.
00189   ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX,
00190                       monitor,
00191                       this->lock_,
00192                       CORBA::INTERNAL ());
00193 
00194   // If we find the mutex, simply return it.
00195   RTCORBA::Mutex_var mutex;
00196   if (this->map_.find (name, mutex) != 0)
00197     throw RTCORBA::RTORB::MutexNotFound ();
00198 
00199   // Return the one we found.
00200   return mutex._retn ();
00201 #else /* TAO_HAS_NAMED_RT_MUTEXES */
00202   ACE_UNUSED_ARG (name);
00203   throw ::CORBA::NO_IMPLEMENT ();
00204 #endif /* TAO_HAS_NAMED_RT_MUTEXES */
00205 }


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:42:57 2010 for TAO_RTCORBA by  doxygen 1.4.7