#include <Mutex.h>
Definition at line 35 of file Mutex.h.
Public Member Functions | |
Mutex (int autoinit=1) | |
Constructor initialize using default atttributes, this depends on how you compiled the library if you chose GNU Pth then the first argument is meaningfull. | |
virtual | ~Mutex () |
This destructor calls dastroy to ensure that all the resources used by the Mutex all released automagically. | |
void | init () |
Initializer, use in case of not using the default constructor (this interface is provided for future compatibility). | |
void | lock () |
Use this to explicitely lock the mutex. | |
void | trylock () |
Use this attemp a lock on the thread, if the mutex has already been locked, then it will throw a corresponding exception. | |
void | unlock () |
Use this to explicitely unlock the mutex. | |
virtual const char * | getClassName () |
Returns the name of the current class. | |
virtual std::string | toString () |
Static Public Member Functions | |
static void | debugmsg (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__) |
Will print a debug message to the screen. | |
static void | debugmsgln (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__) |
Public Attributes | |
pthread_mutex_t | mutex |
The mutex object itself as defined by POSIX Threads GNU Pth or SDL. | |
pthread_mutexattr_t | m_attr |
Protected Attributes | |
std::string | __cls_name |
Private Member Functions | |
void | destroy () |
Destroys the current mutex, freeing all the resources allocated by it. | |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const Object &s) |
xvr2::Mutex::Mutex | ( | int | autoinit = 1 |
) |
Constructor initialize using default atttributes, this depends on how you compiled the library if you chose GNU Pth then the first argument is meaningfull.
virtual xvr2::Mutex::~Mutex | ( | ) | [virtual] |
This destructor calls dastroy to ensure that all the resources used by the Mutex all released automagically.
void xvr2::Mutex::destroy | ( | ) | [private] |
Destroys the current mutex, freeing all the resources allocated by it.
void xvr2::Mutex::init | ( | ) |
Initializer, use in case of not using the default constructor (this interface is provided for future compatibility).
void xvr2::Mutex::lock | ( | ) |
Use this to explicitely lock the mutex.
Referenced by xvr2::SharedVar< bool >::getValue(), xvr2::Vector< xvr2::PipelineFilter * >::lock(), xvr2::Queue< _Tp >::lock(), xvr2::Map< xvr2::String, xvr2::String, xvr2::Net::URI::_cmpf >::lock(), xvr2::Deque< xvr2::Pipeline::task >::lock(), xvr2::SharedVar< bool >::operator!=(), xvr2::SharedVar< bool >::operator++(), xvr2::SharedVar< bool >::operator--(), xvr2::SharedVar< bool >::operator=(), xvr2::SharedVar< bool >::operator==(), and xvr2::SharedVar< bool >::setValue().
void xvr2::Mutex::trylock | ( | ) |
Use this attemp a lock on the thread, if the mutex has already been locked, then it will throw a corresponding exception.
void xvr2::Mutex::unlock | ( | ) |
Use this to explicitely unlock the mutex.
Referenced by xvr2::SharedVar< bool >::getValue(), xvr2::SharedVar< bool >::operator!=(), xvr2::SharedVar< bool >::operator++(), xvr2::SharedVar< bool >::operator--(), xvr2::SharedVar< bool >::operator=(), xvr2::SharedVar< bool >::operator==(), xvr2::SharedVar< bool >::setValue(), xvr2::Vector< xvr2::PipelineFilter * >::unlock(), xvr2::Queue< _Tp >::unlock(), xvr2::Map< xvr2::String, xvr2::String, xvr2::Net::URI::_cmpf >::unlock(), and xvr2::Deque< xvr2::Pipeline::task >::unlock().
virtual const char* xvr2::Object::getClassName | ( | ) | [virtual, inherited] |
Returns the name of the current class.
static void xvr2::Object::debugmsg | ( | Object * | obj, | |
const char * | msg, | |||
int | linenumber = __LINE__ , |
|||
const char * | srcfile = __FILE__ | |||
) | [static, inherited] |
Will print a debug message to the screen.
static void xvr2::Object::debugmsgln | ( | Object * | obj, | |
const char * | msg, | |||
int | linenumber = __LINE__ , |
|||
const char * | srcfile = __FILE__ | |||
) | [static, inherited] |
virtual std::string xvr2::Object::toString | ( | ) | [virtual, inherited] |
std::ostream& operator<< | ( | std::ostream & | stream, | |
const Object & | s | |||
) | [friend, inherited] |
pthread_mutex_t xvr2::Mutex::mutex |
pthread_mutexattr_t xvr2::Mutex::m_attr |
std::string xvr2::Object::__cls_name [protected, inherited] |