Обзор
Примеры
Скриншоты
Сравнения
Приложения
Загрузить
Руководства
Базар
Статус и История
Частые вопросы (FAQ)
Авторы и лицензия
Форум
Помощь проекту
Поиск по сайту
Язык
русский











SourceForge.net Logo



Эта страница еще не переведена. Вы хотите перевести?

 

StaticSemaphore

 

class Semaphore

Well known multithreading synchronization tool. In U++, it is primarily used to block and release thread execution. Semaphore has an internal counter, initially initialized to zero. Wait operation blocks thread execution as long as counter is zero, then decreases it by one. Release operation increases counter by 1.

 

 

Public Method List

 

void Wait()

If internal semaphore counter is zero, waits (blocks calling thread) until some other thread increases this counter by 1 calling the Release method. Before returning, decreases counter by 1.

 


 

void Release()

Increases internal counter by 1.

 

 

Constructor detail

 

Semaphore()

Initializes internal counter to 0.

 

 

 

 

StaticSemaphore

 

class StaticSemaphore

Variant of Semaphore that can be used as static or global variable without the need of initialization  - it has no constructor and correctly performs the first initialization when any of methods is called. That avoids problems with initialization order or multithreaded initialization issues.

 

 

Public Method List

 

Semaphore& Get()

operator Semaphore&()

Returns the Semaphore instance.

 


 

void Wait()

void Release()

Call respective methods of Semaphore instance.

 

 

Страница доступна на english языке. Вы хотите внести вклад?