28 #ifndef __CASEMAPHORE__
29 #define __CASEMAPHORE__
37 m_pSemaphore=
new sem_t;
38 sem_init(m_pSemaphore,0,0);
41 CASemaphore(
int iInitialValue)
43 m_pSemaphore=
new sem_t;
44 sem_init(m_pSemaphore,0,iInitialValue);
49 sem_destroy(m_pSemaphore);
56 if(sem_post(m_pSemaphore)>=0)
64 while((ret=sem_wait(m_pSemaphore))==
E_AGAIN);