2 // FUZZ: disable check_for_ACE_Guard
4 #include "ace/RW_Thread_Mutex.h"
6 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
8 template <class ACE_LOCK> ACE_INLINE int
9 ACE_Guard<ACE_LOCK>::acquire (void)
11 return this->owner_ = this->lock_->acquire ();
14 template <class ACE_LOCK> ACE_INLINE int
15 ACE_Guard<ACE_LOCK>::tryacquire (void)
17 return this->owner_ = this->lock_->tryacquire ();
20 template <class ACE_LOCK> ACE_INLINE int
21 ACE_Guard<ACE_LOCK>::release (void)
23 if (this->owner_ == -1)
28 return this->lock_->release ();
32 template <class ACE_LOCK> ACE_INLINE
33 ACE_Guard<ACE_LOCK>::ACE_Guard (ACE_LOCK &l)
40 template <class ACE_LOCK> ACE_INLINE
41 ACE_Guard<ACE_LOCK>::ACE_Guard (ACE_LOCK &l, bool block)
51 template <class ACE_LOCK> ACE_INLINE
52 ACE_Guard<ACE_LOCK>::ACE_Guard (ACE_LOCK &l, bool /* block */, int become_owner)
54 owner_ (become_owner == 0 ? -1 : 0)
58 // Implicitly and automatically acquire (or try to acquire) the
61 template <class ACE_LOCK> ACE_INLINE
62 ACE_Guard<ACE_LOCK>::~ACE_Guard (void)
67 template <class ACE_LOCK> ACE_INLINE bool
68 ACE_Guard<ACE_LOCK>::locked (void) const
70 return this->owner_ != -1;
73 template <class ACE_LOCK> ACE_INLINE int
74 ACE_Guard<ACE_LOCK>::remove (void)
76 return this->lock_->remove ();
79 template <class ACE_LOCK> ACE_INLINE void
80 ACE_Guard<ACE_LOCK>::disown (void)
85 template <class ACE_LOCK> ACE_INLINE
86 ACE_Write_Guard<ACE_LOCK>::ACE_Write_Guard (ACE_LOCK &m)
87 : ACE_Guard<ACE_LOCK> (&m)
89 this->acquire_write ();
92 template <class ACE_LOCK> ACE_INLINE int
93 ACE_Write_Guard<ACE_LOCK>::acquire_write (void)
95 return this->owner_ = this->lock_->acquire_write ();
98 template <class ACE_LOCK> ACE_INLINE int
99 ACE_Write_Guard<ACE_LOCK>::acquire (void)
101 return this->owner_ = this->lock_->acquire_write ();
104 template <class ACE_LOCK> ACE_INLINE int
105 ACE_Write_Guard<ACE_LOCK>::tryacquire_write (void)
107 return this->owner_ = this->lock_->tryacquire_write ();
110 template <class ACE_LOCK> ACE_INLINE int
111 ACE_Write_Guard<ACE_LOCK>::tryacquire (void)
113 return this->owner_ = this->lock_->tryacquire_write ();
116 template <class ACE_LOCK> ACE_INLINE
117 ACE_Write_Guard<ACE_LOCK>::ACE_Write_Guard (ACE_LOCK &m,
119 : ACE_Guard<ACE_LOCK> (&m)
122 this->acquire_write ();
124 this->tryacquire_write ();
127 template <class ACE_LOCK> ACE_INLINE int
128 ACE_Read_Guard<ACE_LOCK>::acquire_read (void)
130 return this->owner_ = this->lock_->acquire_read ();
133 template <class ACE_LOCK> ACE_INLINE int
134 ACE_Read_Guard<ACE_LOCK>::acquire (void)
136 return this->owner_ = this->lock_->acquire_read ();
139 template <class ACE_LOCK> ACE_INLINE int
140 ACE_Read_Guard<ACE_LOCK>::tryacquire_read (void)
142 return this->owner_ = this->lock_->tryacquire_read ();
145 template <class ACE_LOCK> ACE_INLINE int
146 ACE_Read_Guard<ACE_LOCK>::tryacquire (void)
148 return this->owner_ = this->lock_->tryacquire_read ();
151 template <class ACE_LOCK> ACE_INLINE
152 ACE_Read_Guard<ACE_LOCK>::ACE_Read_Guard (ACE_LOCK &m)
153 : ACE_Guard<ACE_LOCK> (&m)
155 this->acquire_read ();
158 template <class ACE_LOCK> ACE_INLINE
159 ACE_Read_Guard<ACE_LOCK>::ACE_Read_Guard (ACE_LOCK &m,
161 : ACE_Guard<ACE_LOCK> (&m)
164 this->acquire_read ();
166 this->tryacquire_read ();
169 ACE_END_VERSIONED_NAMESPACE_DECL