Improved support for freestanding.

This commit is contained in:
Christoffer Lerno
2023-01-24 22:11:48 +01:00
committed by Christoffer Lerno
parent f37f779e5a
commit a22ebbb0ef
15 changed files with 1152 additions and 45 deletions

View File

@@ -0,0 +1,6 @@
module std::thread;
define NativeMutex = distinct int;
define NativeConditionVariable = distinct int;
define NativeOnceFlag = distinct int;
define NativeThread = distinct int;

View File

@@ -3,9 +3,15 @@ module std::thread;
enum ThreadModel
{
WIN32,
POSIX
POSIX,
NONE
}
$if (env::COMPILER_LIBC_AVAILABLE):
const ThreadModel THREAD_MODEL = env::OS_TYPE == OsType.WIN32 ? ThreadModel.WIN32 : ThreadModel.POSIX;
$else:
const ThreadModel THREAD_MODEL = NONE;
$endif;
define MutexType = distinct int;