| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Attributes
TeSemaphore Class Reference
Multi-programming tools.

Inter process communication semaphore. More...

`#include <TeSemaphore.h>`

List of all members.

## Public Member Functions

| TeSemaphore (unsigned int count)
| Creates an unnamed semaphore.
| TeSemaphore (unsigned int count, const std::string &semName)
| Creates an named semaphore.
| ~TeSemaphore ()
| Default destructor.
void | post ()
| Increments the semaphore's counter.
void | wait ()
| Wait the semaphore's counter to become zero.
bool | wait (unsigned int waitingTime)
| Wait the semaphore's counter to become zero.

## Protected Attributes

std::string | semName_

## Detailed Description

Inter process communication semaphore.

Author:
  Emiliano F. Castejon <castejon@dpi.inpe.br>

## Constructor & Destructor Documentation

TeSemaphore::TeSemaphore | ( | unsigned int | count | ) |

Creates an unnamed semaphore.

Parameters:

  count | Semaphore initial counter value.

TeSemaphore::TeSemaphore | ( | unsigned int | count,
|  | const std::string & | semName
| ) |  |

Creates an named semaphore.

Parameters:

  count | Semaphore initial counter value.
  semName | Semaphore name.

Note:
  Creates a new semaphore or opens an existing semaphore that can be shared among processes.

TeSemaphore::~TeSemaphore | ( |  | ) |

Default destructor.

## Member Function Documentation

void TeSemaphore::post | ( |  | ) | `[inline]`

Increments the semaphore's counter.

bool TeSemaphore::wait | ( | unsigned int | waitingTime | ) |

Wait the semaphore's counter to become zero.

Parameters:

  waitingTime | The maximum waiting time in milliseconds ( 0 == INFINITE ).

Returns:
  true if the semaphore's counter is zero or false if the waiting time has finished or an error occurred.

void TeSemaphore::wait | ( |  | ) | `[inline]`

Wait the semaphore's counter to become zero.

Note:
  If the semaphore's value is greater than zero, then the decrement proceeds, and the function returns, immediately. If the semaphore currently has the value zero, then the call blocks until either it becomes possible to perform the decrement.

## Member Data Documentation

std::string TeSemaphore::semName_`[protected]`

This instance name

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

- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/kernel/TeSemaphore.h
- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/kernel/TeSemaphore.cpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines