Lines Matching refs:Semaphore
47 oslSemaphore Semaphore; in osl_createSemaphore() local
49 Semaphore= malloc(sizeof(sem_t)); in osl_createSemaphore()
51 OSL_ASSERT(Semaphore); /* ptr valid? */ in osl_createSemaphore()
53 if ( Semaphore == 0 ) in osl_createSemaphore()
60 ret= sem_init((sem_t*)Semaphore, 0, initialCount); in osl_createSemaphore()
69 free(Semaphore); in osl_createSemaphore()
70 Semaphore = NULL; in osl_createSemaphore()
73 return Semaphore; in osl_createSemaphore()
79 void SAL_CALL osl_destroySemaphore(oslSemaphore Semaphore) in osl_destroySemaphore() argument
81 if(Semaphore) /* ptr valid? */ in osl_destroySemaphore()
83 sem_destroy((sem_t*)Semaphore); in osl_destroySemaphore()
84 free(Semaphore); in osl_destroySemaphore()
91 sal_Bool SAL_CALL osl_acquireSemaphore(oslSemaphore Semaphore) { in osl_acquireSemaphore() argument
93 OSL_ASSERT(Semaphore != 0); /* abort in debug mode */ in osl_acquireSemaphore()
95 if (Semaphore != 0) /* be tolerant in release mode */ in osl_acquireSemaphore()
97 return (sem_wait((sem_t*)Semaphore) == 0); in osl_acquireSemaphore()
106 sal_Bool SAL_CALL osl_tryToAcquireSemaphore(oslSemaphore Semaphore) { in osl_tryToAcquireSemaphore() argument
108 OSL_ASSERT(Semaphore != 0); /* abort in debug mode */ in osl_tryToAcquireSemaphore()
109 if (Semaphore != 0) /* be tolerant in release mode */ in osl_tryToAcquireSemaphore()
111 return (sem_trywait((sem_t*)Semaphore) == 0); in osl_tryToAcquireSemaphore()
120 sal_Bool SAL_CALL osl_releaseSemaphore(oslSemaphore Semaphore) { in osl_releaseSemaphore() argument
122 OSL_ASSERT(Semaphore != 0); /* abort in debug mode */ in osl_releaseSemaphore()
124 if (Semaphore != 0) /* be tolerant in release mode */ in osl_releaseSemaphore()
126 return (sem_post((sem_t*)Semaphore) == 0); in osl_releaseSemaphore()
166 oslSemaphore Semaphore; in osl_createSemaphore() local
169 Semaphore= malloc(sizeof(osl_TSemImpl)); in osl_createSemaphore()
170 OSL_POSTCOND(Semaphore, "malloc failed\n"); /* ptr valid? */ in osl_createSemaphore()
172 pSem= (osl_TSemImpl*)Semaphore; in osl_createSemaphore()
187 free(Semaphore); in osl_createSemaphore()
206 free(Semaphore); in osl_createSemaphore()
211 return Semaphore; in osl_createSemaphore()
217 void SAL_CALL osl_destroySemaphore(oslSemaphore Semaphore) { in osl_destroySemaphore() argument
219 if(Semaphore) /* ptr valid? */ in osl_destroySemaphore()
223 osl_TSemImpl* pSem= (osl_TSemImpl*)Semaphore; in osl_destroySemaphore()
233 free(Semaphore); in osl_destroySemaphore()
240 sal_Bool SAL_CALL osl_acquireSemaphore(oslSemaphore Semaphore) { in osl_acquireSemaphore() argument
243 OSL_PRECOND(Semaphore != 0, "Semaphore not created\n"); in osl_acquireSemaphore()
246 if (Semaphore != 0) /* be tolerant in release mode */ in osl_acquireSemaphore()
249 osl_TSemImpl* pSem= (osl_TSemImpl*)Semaphore; in osl_acquireSemaphore()
265 sal_Bool SAL_CALL osl_tryToAcquireSemaphore(oslSemaphore Semaphore) { in osl_tryToAcquireSemaphore() argument
268 OSL_PRECOND(Semaphore != 0, "Semaphore not created\n"); in osl_tryToAcquireSemaphore()
270 if (Semaphore != 0) /* be tolerant in release mode */ in osl_tryToAcquireSemaphore()
273 osl_TSemImpl* pSem= (osl_TSemImpl*)Semaphore; in osl_tryToAcquireSemaphore()
288 sal_Bool SAL_CALL osl_releaseSemaphore(oslSemaphore Semaphore) in osl_releaseSemaphore() argument
292 OSL_PRECOND(Semaphore != 0, "Semaphore not created\n"); in osl_releaseSemaphore()
294 if (Semaphore != 0) /* be tolerant in release mode */ in osl_releaseSemaphore()
297 osl_TSemImpl* pSem= (osl_TSemImpl*)Semaphore; in osl_releaseSemaphore()