sems-posix.cpp revision 677833bc953b6cb418c701facbdcf4aa18d6c44e
0N/A * available from http://www.virtualbox.org. This file is free software;
0N/A#ifdef __DARWIN__
struct RTSEMEVENTINTERNAL
struct RTSEMEVENTMULTIINTERNAL
#define EVENT_STATE_UNINITIALIZED 0
struct RTSEMMUTEXINTERNAL
struct RTSEMRWINTERNAL
volatile unsigned uCheck;
uint32_t u32 = pIntEventSem->u32State; /* this is volatile, so a explicit read like this is needed. */
int rc;
struct RTSEMEVENTINTERNAL *pIntEventSem = (struct RTSEMEVENTINTERNAL *)RTMemAlloc(sizeof(struct RTSEMEVENTINTERNAL));
if (pIntEventSem)
if (!rc)
if (!rc)
if (!rc)
if (!rc)
return VINF_SUCCESS;
return rc;
return VERR_INVALID_HANDLE;
int rc;
if (rc)
if (rc)
return VINF_SUCCESS;
return VERR_INVALID_HANDLE;
if (rc)
if (rc)
if (rc2)
return VINF_SUCCESS;
return VERR_INVALID_HANDLE;
if (rc)
return VINF_SUCCESS;
return VERR_SEM_DESTROYED;
if (rc)
#ifdef __DARWIN__
if (cMillies != 0)
#ifdef __DARWIN__
if (rc)
return VINF_SUCCESS;
return VERR_SEM_DESTROYED;
if (rc && (rc != EINTR || !fAutoResume)) /* according to SuS this function shall not return EINTR, but linux man page says differently. */
return rc;
uint32_t u32 = pIntEventMultiSem->u32State; /* this is volatile, so a explicit read like this is needed. */
return VERR_INVALID_HANDLE;
if (rc)
if (rc)
return VINF_SUCCESS;
return VERR_INVALID_HANDLE;
if (rc)
return VINF_SUCCESS;
return VERR_SEM_DESTROYED;
if (rc)
#ifdef __DARWIN__
if (cMillies != 0)
#ifdef __DARWIN__
if (rc)
return VINF_SUCCESS;
return VERR_SEM_DESTROYED;
if (rc && (rc != EINTR || !fAutoResume)) /* according to SuS this function shall not return EINTR, but linux man page says differently. */
return rc;
int rc;
struct RTSEMMUTEXINTERNAL *pIntMutexSem = (struct RTSEMMUTEXINTERNAL *)RTMemAlloc(sizeof(struct RTSEMMUTEXINTERNAL));
if (pIntMutexSem)
if (!rc)
if (!rc)
return VINF_SUCCESS;
return rc;
return VERR_INVALID_HANDLE;
if (rc)
return VINF_SUCCESS;
return VERR_INVALID_HANDLE;
return VINF_SUCCESS;
if (rc)
#ifdef __DARWIN__
return VERR_NOT_IMPLEMENTED;
if (cMillies != 0)
if (rc)
return VINF_SUCCESS;
return VERR_INVALID_HANDLE;
return VERR_NOT_OWNER;
return VINF_SUCCESS;
if (rc)
return VINF_SUCCESS;
int rc;
struct RTSEMRWINTERNAL *pIntRWSem = (struct RTSEMRWINTERNAL *)RTMemAlloc(sizeof(struct RTSEMRWINTERNAL));
if (pIntRWSem)
if (!rc)
if (!rc)
return VINF_SUCCESS;
return rc;
return VERR_INVALID_HANDLE;
if (!rc)
return rc;
return VERR_INVALID_HANDLE;
if (rc)
#ifdef __DARWIN__
return VERR_NOT_IMPLEMENTED;
if (cMillies != 0)
if (rc)
return VINF_SUCCESS;
return VERR_INVALID_HANDLE;
return VERR_NOT_OWNER;
if (rc)
return VINF_SUCCESS;
return VERR_INVALID_HANDLE;
if (rc)
#ifdef __DARWIN__
return VERR_NOT_IMPLEMENTED;
if (cMillies != 0)
if (rc)
return VINF_SUCCESS;
return VERR_INVALID_HANDLE;
return VERR_NOT_OWNER;
AssertMsg(sizeof(pthread_t) == sizeof(void *), ("pthread_t is not the size of a pointer but %d bytes\n", sizeof(pthread_t)));
if (rc)
return VINF_SUCCESS;