sc_sem Struct Reference

A portable counting semaphore for pthreads. More...

#include <si_sys/pthrdsem.h>

List of all members.

Public Attributes

pthread_mutex_t m
pthread_cond_t c
s_int32 count
s_int32 max


Detailed Description

A portable counting semaphore for pthreads.

Lightweight, portable simple counting semaphore for use with pthreads. This exists because Mac OS X does not support anonymous semaphores (sem_init).

Note:
If a inter-process semaphore is desired, use posix semaphores, they are portable across linux implementations and OS X.

Member Data Documentation

pthread_cond_t sc_sem::c

Condition variable for blocking when count is 0.

s_int32 sc_sem::count

The current semaphore count.

pthread_mutex_t sc_sem::m

Mutex protecting condition variable c.

s_int32 sc_sem::max

The maximum semaphore count.


The documentation for this struct was generated from the following file:

doxygen