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

clawsoft::ConditionVar Class Reference

#include <ConditionVar.h>

Inheritance diagram for clawsoft::ConditionVar:

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

Collaboration graph
[legend]

Detailed Description

Condition variables is another type of synchronization device unlike the Mutex how locks and unlocks a thread, this devide does somethings a bit different, this one waits for a condition to be reached, if the condition in fact has been accomplished it will lock and unlock a thread or a set of threads that might be waiting for a conditiond to be reached on that specific ConditionVar object.

STATUS: READY TO TEST


Public Methods

void signal ()
 This will restart just one of the threads that are waiting for the condition to be reached.

void broadcast ()
 This will restart all the threads that are waiting for the condition to be reached.

void wait (Mutex *mutex)
 This will unlock the Mutex mutex and will wait for this condition variable to be signaled.

void timedWait (Mutex *mutex, long seconds=1, long nanoseconds=0)
 This will unlock the Mutex mutex and will wait for this condition variable to be signaled.

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


Static Public Methods

void wait (ConditionVar *cv, Mutex *mutex)
 This is the static version of the wait method.

void timedWait (ConditionVar *cv, Mutex *mutex, long seconds=1, long nanoseconds=0)
 This is the static version of the timedWait method.

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.


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.


Member Function Documentation

void clawsoft::ConditionVar::broadcast  
 

This will restart all the threads that are waiting for the condition to be reached.

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

This will return the CPU speed in megahertz.

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.

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

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

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.

void clawsoft::ConditionVar::signal  
 

This will restart just one of the threads that are waiting for the condition to be reached.

void clawsoft::ConditionVar::timedWait ConditionVar *    cv,
Mutex   mutex,
long    seconds = 1,
long    nanoseconds = 0
[static]
 

This is the static version of the timedWait method.

void clawsoft::ConditionVar::timedWait Mutex   mutex,
long    seconds = 1,
long    nanoseconds = 0
 

This will unlock the Mutex mutex and will wait for this condition variable to be signaled.

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

Will return the total amount of system memory.

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

Will freeze the software for usec microseconds.

void clawsoft::ConditionVar::wait ConditionVar *    cv,
Mutex   mutex
[static]
 

This is the static version of the wait method.

void clawsoft::ConditionVar::wait Mutex   mutex
 

This will unlock the Mutex mutex and will wait for this condition variable to be signaled.


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

Authors:

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

Powered by:

SourceForgeLogo