00001 // $Id: Reverse_Lock_T.cpp 69051 2005-10-28 16:14:56Z ossama $ 00002 00003 #ifndef ACE_REVERSE_LOCK_T_CPP 00004 #define ACE_REVERSE_LOCK_T_CPP 00005 00006 #include "ace/Reverse_Lock_T.h" 00007 00008 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00009 # pragma once 00010 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00011 00012 #if !defined (__ACE_INLINE__) 00013 #include "ace/Reverse_Lock_T.inl" 00014 #endif /* __ACE_INLINE__ */ 00015 00016 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00017 00018 template <class ACE_LOCKING_MECHANISM> 00019 ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::~ACE_Reverse_Lock (void) 00020 { 00021 } 00022 00023 // Explicitly destroy the lock. 00024 template <class ACE_LOCKING_MECHANISM> int 00025 ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::remove (void) 00026 { 00027 return this->lock_.remove (); 00028 } 00029 00030 // Release the lock. 00031 template <class ACE_LOCKING_MECHANISM> int 00032 ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::acquire (void) 00033 { 00034 return this->lock_.release (); 00035 } 00036 00037 // Release the lock. 00038 template <class ACE_LOCKING_MECHANISM> int 00039 ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::tryacquire (void) 00040 { 00041 ACE_NOTSUP_RETURN (-1); 00042 } 00043 00044 // Acquire the lock. 00045 template <class ACE_LOCKING_MECHANISM> int 00046 ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::release (void) 00047 { 00048 if (this->acquire_method_ == ACE_Acquire_Method::ACE_READ) 00049 return this->lock_.acquire_read (); 00050 else if (this->acquire_method_ == ACE_Acquire_Method::ACE_WRITE) 00051 return this->lock_.acquire_write (); 00052 else 00053 return this->lock_.acquire (); 00054 } 00055 00056 // Release the lock. 00057 template <class ACE_LOCKING_MECHANISM> int 00058 ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::acquire_read (void) 00059 { 00060 ACE_NOTSUP_RETURN (-1); 00061 } 00062 00063 // Release the lock. 00064 template <class ACE_LOCKING_MECHANISM> int 00065 ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::acquire_write (void) 00066 { 00067 ACE_NOTSUP_RETURN (-1); 00068 } 00069 00070 // Release the lock. 00071 template <class ACE_LOCKING_MECHANISM> int 00072 ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::tryacquire_read (void) 00073 { 00074 ACE_NOTSUP_RETURN (-1); 00075 } 00076 00077 // Release the lock. 00078 template <class ACE_LOCKING_MECHANISM> int 00079 ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::tryacquire_write (void) 00080 { 00081 ACE_NOTSUP_RETURN (-1); 00082 } 00083 00084 // Release the lock. 00085 template <class ACE_LOCKING_MECHANISM> int 00086 ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::tryacquire_write_upgrade (void) 00087 { 00088 ACE_NOTSUP_RETURN (-1); 00089 } 00090 00091 ACE_END_VERSIONED_NAMESPACE_DECL 00092 00093 #endif /* ACE_REVERSE_LOCK_T_CPP */