// -*- C++ -*- // FUZZ: disable check_for_ACE_Guard #include "ace/RW_Thread_Mutex.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL template ACE_INLINE int ACE_Guard::acquire () { return this->owner_ = this->lock_->acquire (); } template ACE_INLINE int ACE_Guard::tryacquire () { return this->owner_ = this->lock_->tryacquire (); } template ACE_INLINE int ACE_Guard::release () { if (this->owner_ == -1) return -1; else { this->owner_ = -1; return this->lock_->release (); } } template ACE_INLINE ACE_Guard::ACE_Guard (ACE_LOCK &l) : lock_ (&l), owner_ (0) { this->acquire (); } template ACE_INLINE ACE_Guard::ACE_Guard (ACE_LOCK &l, bool block) : lock_ (&l), owner_ (0) { if (block) this->acquire (); else this->tryacquire (); } template ACE_INLINE ACE_Guard::ACE_Guard (ACE_LOCK &l, bool /* block */, int become_owner) : lock_ (&l), owner_ (become_owner == 0 ? -1 : 0) { } // Implicitly and automatically acquire (or try to acquire) the // lock. template ACE_INLINE ACE_Guard::~ACE_Guard () { this->release (); } template ACE_INLINE bool ACE_Guard::locked () const { return this->owner_ != -1; } template ACE_INLINE int ACE_Guard::remove () { return this->lock_->remove (); } template ACE_INLINE void ACE_Guard::disown () { this->owner_ = -1; } template ACE_INLINE ACE_Write_Guard::ACE_Write_Guard (ACE_LOCK &m) : ACE_Guard (&m) { this->acquire_write (); } template ACE_INLINE int ACE_Write_Guard::acquire_write () { return this->owner_ = this->lock_->acquire_write (); } template ACE_INLINE int ACE_Write_Guard::acquire () { return this->owner_ = this->lock_->acquire_write (); } template ACE_INLINE int ACE_Write_Guard::tryacquire_write () { return this->owner_ = this->lock_->tryacquire_write (); } template ACE_INLINE int ACE_Write_Guard::tryacquire () { return this->owner_ = this->lock_->tryacquire_write (); } template ACE_INLINE ACE_Write_Guard::ACE_Write_Guard (ACE_LOCK &m, bool block) : ACE_Guard (&m) { if (block) this->acquire_write (); else this->tryacquire_write (); } template ACE_INLINE int ACE_Read_Guard::acquire_read () { return this->owner_ = this->lock_->acquire_read (); } template ACE_INLINE int ACE_Read_Guard::acquire () { return this->owner_ = this->lock_->acquire_read (); } template ACE_INLINE int ACE_Read_Guard::tryacquire_read () { return this->owner_ = this->lock_->tryacquire_read (); } template ACE_INLINE int ACE_Read_Guard::tryacquire () { return this->owner_ = this->lock_->tryacquire_read (); } template ACE_INLINE ACE_Read_Guard::ACE_Read_Guard (ACE_LOCK &m) : ACE_Guard (&m) { this->acquire_read (); } template ACE_INLINE ACE_Read_Guard::ACE_Read_Guard (ACE_LOCK &m, bool block) : ACE_Guard (&m) { if (block) this->acquire_read (); else this->tryacquire_read (); } ACE_END_VERSIONED_NAMESPACE_DECL