37 #ifndef ACTIONLIB__DESTRUCTION_GUARD_H_ 38 #define ACTIONLIB__DESTRUCTION_GUARD_H_ 40 #include <boost/thread/condition.hpp> 41 #include <boost/thread/mutex.hpp> 59 boost::mutex::scoped_lock lock(
mutex_);
72 boost::mutex::scoped_lock lock(
mutex_);
85 boost::mutex::scoped_lock lock(
mutex_);
138 #endif // ACTIONLIB__DESTRUCTION_GUARD_H_ ScopedProtector(DestructionGuard &guard)
Constructor for a ScopedProtector.
DestructionGuard & guard_
bool isProtected()
Checks if the ScopedProtector successfully protected the DestructionGuard.
boost::condition count_condition_
~ScopedProtector()
Releases protection of the DestructionGuard if necessary.
bool tryProtect()
Attempts to protect the guarded object from being destructed.
This class protects an object from being destructed until all users of that object relinquish control...
void unprotect()
Releases protection on the guarded object.
DestructionGuard()
Constructor for a DestructionGuard.
Protects a DestructionGuard until this object goes out of scope.