Lines Matching refs:Semaphore
41 oslSemaphore Semaphore; in osl_createSemaphore() local
43 Semaphore= CreateSemaphore(0, initialCount, INT_MAX, 0); in osl_createSemaphore()
46 if((HANDLE)Semaphore == INVALID_HANDLE_VALUE) in osl_createSemaphore()
48 Semaphore= 0; in osl_createSemaphore()
51 return Semaphore; in osl_createSemaphore()
57 void SAL_CALL osl_destroySemaphore(oslSemaphore Semaphore) in osl_destroySemaphore() argument
61 if(Semaphore != 0) in osl_destroySemaphore()
63 CloseHandle((HANDLE)Semaphore); in osl_destroySemaphore()
71 sal_Bool SAL_CALL osl_acquireSemaphore(oslSemaphore Semaphore) in osl_acquireSemaphore() argument
73 OSL_ASSERT(Semaphore != 0); in osl_acquireSemaphore()
75 switch ( WaitForSingleObject( (HANDLE)Semaphore, INFINITE ) ) in osl_acquireSemaphore()
88 sal_Bool SAL_CALL osl_tryToAcquireSemaphore(oslSemaphore Semaphore) in osl_tryToAcquireSemaphore() argument
90 OSL_ASSERT(Semaphore != 0); in osl_tryToAcquireSemaphore()
91 return (sal_Bool)(WaitForSingleObject((HANDLE)Semaphore, 0) == WAIT_OBJECT_0); in osl_tryToAcquireSemaphore()
98 sal_Bool SAL_CALL osl_releaseSemaphore(oslSemaphore Semaphore) in osl_releaseSemaphore() argument
100 OSL_ASSERT(Semaphore != 0); in osl_releaseSemaphore()
103 return (sal_Bool)(ReleaseSemaphore((HANDLE)Semaphore, 1, NULL) != FALSE); in osl_releaseSemaphore()