This commit is contained in:
Branimir Karadžić
2018-03-11 18:30:43 -07:00
parent c57e759edb
commit cbd6d16338
4 changed files with 112 additions and 28 deletions

View File

@@ -8,8 +8,9 @@
#if BX_CONFIG_SUPPORTS_THREADING
#if BX_PLATFORM_OSX \
|| BX_PLATFORM_IOS
#if BX_CRT_NONE
#elif BX_PLATFORM_OSX \
|| BX_PLATFORM_IOS
# include <dispatch/dispatch.h>
#elif BX_PLATFORM_POSIX
# include <errno.h>
@@ -30,8 +31,10 @@ namespace bx
{
struct SemaphoreInternal
{
#if BX_PLATFORM_OSX \
|| BX_PLATFORM_IOS
#if BX_CRT_NONE
#elif BX_PLATFORM_OSX \
|| BX_PLATFORM_IOS
dispatch_semaphore_t m_handle;
#elif BX_PLATFORM_POSIX
pthread_mutex_t m_mutex;
@@ -44,8 +47,28 @@ namespace bx
#endif // BX_PLATFORM_
};
#if BX_PLATFORM_OSX \
|| BX_PLATFORM_IOS
#if BX_CRT_NONE
Semaphore::Semaphore()
{
BX_STATIC_ASSERT(sizeof(SemaphoreInternal) <= sizeof(m_internal) );
}
Semaphore::~Semaphore()
{
}
void Semaphore::post(uint32_t _count)
{
BX_UNUSED(_count);
}
bool Semaphore::wait(int32_t _msecs)
{
BX_UNUSED(_msecs);
return false;
}
#elif BX_PLATFORM_OSX \
|| BX_PLATFORM_IOS
Semaphore::Semaphore()
{