Refactor protocols.

This commit is contained in:
Christoffer Lerno
2023-10-06 20:29:20 +02:00
committed by Christoffer Lerno
parent f3e3aa231d
commit 99cfaa1583
98 changed files with 756 additions and 590 deletions

View File

@@ -1,6 +1,6 @@
module std::thread::os @if (!env::POSIX && !env::WIN32);
def NativeMutex = distinct int;
def NativeConditionVariable = distinct int;
def NativeOnceFlag = distinct int;
def NativeThread = distinct int;
distinct NativeMutex = int;
distinct NativeConditionVariable = int;
distinct NativeOnceFlag = int;
distinct NativeThread = int;

View File

@@ -1,7 +1,7 @@
module std::thread::os @if(env::WIN32);
import std::os::win32;
def NativeThread = distinct inline Win32_HANDLE;
distinct NativeThread = inline Win32_HANDLE;
struct NativeMutex
{

View File

@@ -1,19 +1,19 @@
module std::thread;
import std::thread::os;
def MutexType = distinct int;
distinct MutexType = int;
const MutexType MUTEX_PLAIN = 0;
const MutexType MUTEX_TIMED = 1;
const MutexType MUTEX_RECURSIVE = 2;
def Mutex = distinct NativeMutex;
def TimedMutex = distinct inline Mutex;
def RecursiveMutex = distinct inline Mutex;
def TimedRecursiveMutex = distinct inline Mutex;
def ConditionVariable = distinct NativeConditionVariable;
def Thread = distinct NativeThread;
def OnceFlag = distinct NativeOnceFlag;
distinct Mutex = NativeMutex;
distinct TimedMutex = inline Mutex;
distinct RecursiveMutex = inline Mutex;
distinct TimedRecursiveMutex = inline Mutex;
distinct ConditionVariable = NativeConditionVariable;
distinct Thread = NativeThread;
distinct OnceFlag = NativeOnceFlag;
def OnceFn = fn void();
def ThreadFn = fn int(void* arg);