Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
WinRT: made the skeleton C++11 thread implementation use .cpp files, …
- Loading branch information
|
@@ -91,9 +91,9 @@ |
|
|
<ClCompile Include="..\..\src\stdlib\SDL_string.c" /> |
|
|
<ClCompile Include="..\..\src\thread\generic\SDL_syssem.c" /> |
|
|
<ClCompile Include="..\..\src\thread\SDL_thread.c" /> |
|
|
<ClCompile Include="..\..\src\thread\stdcpp\SDL_syscond.c" /> |
|
|
<ClCompile Include="..\..\src\thread\stdcpp\SDL_sysmutex.c" /> |
|
|
<ClCompile Include="..\..\src\thread\stdcpp\SDL_systhread.c" /> |
|
|
<ClCompile Include="..\..\src\thread\stdcpp\SDL_syscond.cpp" /> |
|
|
<ClCompile Include="..\..\src\thread\stdcpp\SDL_sysmutex.cpp" /> |
|
|
<ClCompile Include="..\..\src\thread\stdcpp\SDL_systhread.cpp" /> |
|
|
<ClCompile Include="..\..\src\timer\dummy\SDL_systimer.c" /> |
|
|
<ClCompile Include="..\..\src\timer\SDL_timer.c" /> |
|
|
<ClCompile Include="..\..\src\video\dummy\SDL_nullevents.c" /> |
|
|
|
@@ -38,6 +38,7 @@ struct SDL_cond |
|
|
}; |
|
|
|
|
|
/* Create a condition variable */ |
|
|
extern "C" |
|
|
SDL_cond * |
|
|
SDL_CreateCond(void) |
|
|
{ |
|
@@ -60,6 +61,7 @@ SDL_CreateCond(void) |
|
|
} |
|
|
|
|
|
/* Destroy a condition variable */ |
|
|
extern "C" |
|
|
void |
|
|
SDL_DestroyCond(SDL_cond * cond) |
|
|
{ |
|
@@ -78,6 +80,7 @@ SDL_DestroyCond(SDL_cond * cond) |
|
|
} |
|
|
|
|
|
/* Restart one of the threads that are waiting on the condition variable */ |
|
|
extern "C" |
|
|
int |
|
|
SDL_CondSignal(SDL_cond * cond) |
|
|
{ |
|
@@ -103,6 +106,7 @@ SDL_CondSignal(SDL_cond * cond) |
|
|
} |
|
|
|
|
|
/* Restart all threads that are waiting on the condition variable */ |
|
|
extern "C" |
|
|
int |
|
|
SDL_CondBroadcast(SDL_cond * cond) |
|
|
{ |
|
@@ -158,6 +162,7 @@ Thread B: |
|
|
SDL_CondSignal(cond); |
|
|
SDL_UnlockMutex(lock); |
|
|
*/ |
|
|
extern "C" |
|
|
int |
|
|
SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms) |
|
|
{ |
|
@@ -214,6 +219,7 @@ SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms) |
|
|
} |
|
|
|
|
|
/* Wait on the condition variable forever */ |
|
|
extern "C" |
|
|
int |
|
|
SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex) |
|
|
{ |
|
|
|
@@ -34,6 +34,7 @@ struct SDL_mutex |
|
|
}; |
|
|
|
|
|
/* Create a mutex */ |
|
|
extern "C" |
|
|
SDL_mutex * |
|
|
SDL_CreateMutex(void) |
|
|
{ |
|
@@ -57,6 +58,7 @@ SDL_CreateMutex(void) |
|
|
} |
|
|
|
|
|
/* Free the mutex */ |
|
|
extern "C" |
|
|
void |
|
|
SDL_DestroyMutex(SDL_mutex * mutex) |
|
|
{ |
|
@@ -69,6 +71,7 @@ SDL_DestroyMutex(SDL_mutex * mutex) |
|
|
} |
|
|
|
|
|
/* Lock the semaphore */ |
|
|
extern "C" |
|
|
int |
|
|
SDL_mutexP(SDL_mutex * mutex) |
|
|
{ |
|
@@ -100,6 +103,7 @@ SDL_mutexP(SDL_mutex * mutex) |
|
|
} |
|
|
|
|
|
/* Unlock the mutex */ |
|
|
extern "C" |
|
|
int |
|
|
SDL_mutexV(SDL_mutex * mutex) |
|
|
{ |
|
|
|
@@ -22,34 +22,41 @@ |
|
|
|
|
|
/* Thread management routines for SDL */ |
|
|
|
|
|
extern "C" { |
|
|
#include "SDL_thread.h" |
|
|
#include "../SDL_systhread.h" |
|
|
} |
|
|
|
|
|
extern "C" |
|
|
int |
|
|
SDL_SYS_CreateThread(SDL_Thread * thread, void *args) |
|
|
{ |
|
|
SDL_SetError("Threads are not supported on this platform"); |
|
|
return (-1); |
|
|
} |
|
|
|
|
|
extern "C" |
|
|
void |
|
|
SDL_SYS_SetupThread(const char *name) |
|
|
{ |
|
|
return; |
|
|
} |
|
|
|
|
|
extern "C" |
|
|
SDL_threadID |
|
|
SDL_ThreadID(void) |
|
|
{ |
|
|
return (0); |
|
|
} |
|
|
|
|
|
extern "C" |
|
|
int |
|
|
SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) |
|
|
{ |
|
|
return (0); |
|
|
} |
|
|
|
|
|
extern "C" |
|
|
void |
|
|
SDL_SYS_WaitThread(SDL_Thread * thread) |
|
|
{ |
|
|