RT_Mutex.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file   RT_Mutex.h
00006  *
00007  *  $Id: RT_Mutex.h 81429 2008-04-24 18:49:54Z johnnyw $
00008  *
00009  *  @author Frank Hunleth <fhunleth@cs.wustl.edu>
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef TAO_RT_MUTEX_H
00015 #define TAO_RT_MUTEX_H
00016 
00017 #include /**/ "ace/pre.h"
00018 #include "tao/orbconf.h"
00019 
00020 #if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
00021 
00022 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00023 # pragma once
00024 #endif /* ACE_LACKS_PRAGMA_ONCE */
00025 
00026 #include "tao/RTCORBA/RTCORBA_includeC.h"
00027 #include "tao/LocalObject.h"
00028 
00029 #if (TAO_HAS_NAMED_RT_MUTEXES == 1)
00030 # include "ace/SString.h"
00031 #endif /* TAO_HAS_NAMED_RT_MUTEXES == 1 */
00032 
00033 #if defined(_MSC_VER)
00034 #pragma warning(push)
00035 #pragma warning(disable:4250)
00036 #endif /* _MSC_VER */
00037 
00038 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00039 
00040 /**
00041  * @class TAO_RT_Mutex
00042  *
00043  * @brief  Abstract base class for the TAO RT Mutex implementations
00044  *
00045  * This class just serves as a base class for any of the TAO
00046  * RT Mutex implementations.  Instances of these classes should
00047  * be created using the RTCORBA::create_mutex() method.
00048  *
00049  */
00050 
00051 class TAO_RTCORBA_Export TAO_RT_Mutex
00052   : public RTCORBA::Mutex,
00053     public ::CORBA::LocalObject
00054 {
00055 public:
00056 
00057   /// Acquire the lock.
00058   virtual void lock (void);
00059 
00060   /// Release the lock.
00061   virtual void unlock (void);
00062 
00063   /**
00064    * Acquire the lock, but only wait up to @a max_wait time.  Note
00065    * that this operation may not be available on all OS platforms, so
00066    * if you're interested in writing maximally portable programs avoid
00067    * using this operation in your program designs.
00068    */
00069   virtual CORBA::Boolean try_lock (TimeBase::TimeT max_wait
00070                                    );
00071 
00072   /// Returns the name of the mutex.
00073   virtual const char *name (void) const;
00074 
00075 protected:
00076 
00077   /// Destructor.
00078   virtual ~TAO_RT_Mutex (void);
00079 
00080 protected:
00081   /// Synchronization lock.
00082   TAO_SYNCH_MUTEX mu_;
00083 };
00084 
00085 #if (TAO_HAS_NAMED_RT_MUTEXES == 1)
00086 /**
00087  * @class TAO_Named_RT_Mutex
00088  *
00089  * @brief Extension to TAO_RT_Mutex to support named mutexes.
00090  *
00091  */
00092 class TAO_RTCORBA_Export TAO_Named_RT_Mutex : public TAO_RT_Mutex
00093 {
00094 public:
00095   /// Constructor.
00096   TAO_Named_RT_Mutex (const char *name);
00097 
00098   /// Returns the name of the mutex.
00099   virtual const char *name (void) const;
00100 
00101 protected:
00102 
00103   /// My name.
00104   ACE_CString name_;
00105 };
00106 #endif /* TAO_HAS_NAMED_RT_MUTEXES == 1 */
00107 
00108 TAO_END_VERSIONED_NAMESPACE_DECL
00109 
00110 #if defined(_MSC_VER)
00111 #pragma warning(pop)
00112 #endif /* _MSC_VER */
00113 
00114 #endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */
00115 
00116 #include /**/ "ace/post.h"
00117 #endif /* TAO_RT_MUTEX_H */

Generated on Tue Feb 2 17:42:49 2010 for TAO_RTCORBA by  doxygen 1.4.7