Add initial implementation of threads/mutexes/semaphores/cvs/spinlocks
Added initial implementation (or wrapper) of the threading library. It's rather basic, but should work for most of the tasks. Unfortunately, spinlock implementation relies on GCC/Clang compiler built-ins (or in-worst-case-scenario on Win32 - InterlockExchange). In the future, I should revisit this code and fix/reimplement some stuff (or add support for Windows XP).
This commit is contained in:
51
src/Platform/Dummy/Semaphore.c
Normal file
51
src/Platform/Dummy/Semaphore.c
Normal file
@@ -0,0 +1,51 @@
|
||||
#include "Thread.h"
|
||||
|
||||
#include <BH/Thread.h>
|
||||
|
||||
|
||||
BH_Semaphore *BH_SemaphoreNew(int value)
|
||||
{
|
||||
BH_UNUSED(value);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
void BH_SemaphoreFree(BH_Semaphore *semaphore)
|
||||
{
|
||||
BH_UNUSED(semaphore);
|
||||
}
|
||||
|
||||
|
||||
int BH_SemaphorePost(BH_Semaphore *semaphore)
|
||||
{
|
||||
BH_UNUSED(semaphore);
|
||||
|
||||
return BH_NOIMPL;
|
||||
}
|
||||
|
||||
|
||||
int BH_SemaphoreWait(BH_Semaphore *semaphore)
|
||||
{
|
||||
BH_UNUSED(semaphore);
|
||||
|
||||
return BH_NOIMPL;
|
||||
}
|
||||
|
||||
|
||||
int BH_SemaphoreWaitTry(BH_Semaphore *semaphore)
|
||||
{
|
||||
BH_UNUSED(semaphore);
|
||||
|
||||
return BH_NOIMPL;
|
||||
}
|
||||
|
||||
|
||||
int BH_SemaphoreWaitFor(BH_Semaphore *semaphore,
|
||||
uint32_t timeout)
|
||||
{
|
||||
BH_UNUSED(semaphore);
|
||||
BH_UNUSED(timeout);
|
||||
|
||||
return BH_NOIMPL;
|
||||
}
|
||||
Reference in New Issue
Block a user