Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields  

clawsoft::Mutex Class Reference

#include <Mutex.h>

Inheritance diagram for clawsoft::Mutex:

Inheritance graph
[legend]
Collaboration diagram for clawsoft::Mutex:

Collaboration graph
[legend]

Detailed Description

This classes handle MUTEX (MUtuak EXclusion) sinchronization devices
This classes are designed to work with SDL's Thread encapsulation, GNU Pth or POSIX Threads.


Public Methods

 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.

 ~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 lock the mutex explicitely.

void unlock ()
 Use this to unlock the mutex explicitely.

const char * getClassName ()
 Returns the name of the current class.


Static Public Methods

int installedCPUs ()
 This will return how many CPUs are installed in the system.

double cpuSpeed ()
 This will return the CPU speed in megahertz.

int totalMemory ()
 Will return the total amount of system memory.

int freeMemory ()
 Will return the total amount of free system memory.

void usleep (Uint32 usec)
 Will freeze the software for usec microseconds.


Data Fields

pthread_mutex_t mutex
 The mutex object itself as defined by POSIX Threads GNU Pth or SDL.


Protected Methods

void setClassName (const char *n)
 Call this method when you need to set the name of the class you're creating, typically in it's constructor, remember that you must set the classname for every class you create, that way you can have more information while debugging.


Private Methods

void destroy ()
 Destroys the current mutex, freeing all the resources allocated by it.


Constructor & Destructor Documentation

clawsoft::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.

clawsoft::Mutex::~Mutex   [inline]
 

This destructor calls dastroy to ensure that all the resources used by the Mutex all released automagically.


Member Function Documentation

double clawsoft::System::cpuSpeed   [static, inherited]
 

This will return the CPU speed in megahertz.

void clawsoft::Mutex::destroy   [private]
 

Destroys the current mutex, freeing all the resources allocated by it.

int clawsoft::System::freeMemory   [static, inherited]
 

Will return the total amount of free system memory.

const char * clawsoft::Object::getClassName   [inherited]
 

Returns the name of the current class.

void clawsoft::Mutex::init  
 

Initializer, use in case of not using the default constructor (this interface is provided for future compatibility).

int clawsoft::System::installedCPUs   [static, inherited]
 

This will return how many CPUs are installed in the system.

void clawsoft::Mutex::lock  
 

Use this to lock the mutex explicitely.

void clawsoft::Object::setClassName const char *    n [protected, inherited]
 

Call this method when you need to set the name of the class you're creating, typically in it's constructor, remember that you must set the classname for every class you create, that way you can have more information while debugging.

int clawsoft::System::totalMemory   [static, inherited]
 

Will return the total amount of system memory.

void clawsoft::Mutex::unlock  
 

Use this to unlock the mutex explicitely.

void clawsoft::System::usleep Uint32    usec [static, inherited]
 

Will freeze the software for usec microseconds.


Field Documentation

pthread_mutex_t clawsoft::Mutex::mutex
 

The mutex object itself as defined by POSIX Threads GNU Pth or SDL.


The documentation for this class was generated from the following files:

Authors:

Juan V. Guerrero
Jannette C. Mejia
Juan C. Guevara

Powered by:

SourceForgeLogo