Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / ACE / ace / Reverse_Lock_T.cpp
blob047e921520ff923d6a42adf003e9d33a5584859d
1 #ifndef ACE_REVERSE_LOCK_T_CPP
2 #define ACE_REVERSE_LOCK_T_CPP
4 #include "ace/Reverse_Lock_T.h"
6 #if !defined (ACE_LACKS_PRAGMA_ONCE)
7 # pragma once
8 #endif /* ACE_LACKS_PRAGMA_ONCE */
10 #if !defined (__ACE_INLINE__)
11 #include "ace/Reverse_Lock_T.inl"
12 #endif /* __ACE_INLINE__ */
14 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
16 // Explicitly destroy the lock.
17 template <class ACE_LOCKING_MECHANISM> int
18 ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::remove ()
20 return this->lock_.remove ();
23 // Release the lock.
24 template <class ACE_LOCKING_MECHANISM> int
25 ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::acquire ()
27 return this->lock_.release ();
30 // Release the lock.
31 template <class ACE_LOCKING_MECHANISM> int
32 ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::tryacquire ()
34 ACE_NOTSUP_RETURN (-1);
37 // Acquire the lock.
38 template <class ACE_LOCKING_MECHANISM> int
39 ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::release ()
41 if (this->acquire_method_ == ACE_Acquire_Method::ACE_READ)
42 return this->lock_.acquire_read ();
43 else if (this->acquire_method_ == ACE_Acquire_Method::ACE_WRITE)
44 return this->lock_.acquire_write ();
45 else
46 return this->lock_.acquire ();
49 // Release the lock.
50 template <class ACE_LOCKING_MECHANISM> int
51 ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::acquire_read ()
53 ACE_NOTSUP_RETURN (-1);
56 // Release the lock.
57 template <class ACE_LOCKING_MECHANISM> int
58 ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::acquire_write ()
60 ACE_NOTSUP_RETURN (-1);
63 // Release the lock.
64 template <class ACE_LOCKING_MECHANISM> int
65 ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::tryacquire_read ()
67 ACE_NOTSUP_RETURN (-1);
70 // Release the lock.
71 template <class ACE_LOCKING_MECHANISM> int
72 ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::tryacquire_write ()
74 ACE_NOTSUP_RETURN (-1);
77 // Release the lock.
78 template <class ACE_LOCKING_MECHANISM> int
79 ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::tryacquire_write_upgrade ()
81 ACE_NOTSUP_RETURN (-1);
84 ACE_END_VERSIONED_NAMESPACE_DECL
86 #endif /* ACE_REVERSE_LOCK_T_CPP */