diff options
author | Araq <rumpf_a@web.de> | 2010-12-07 17:11:35 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2010-12-07 17:11:35 +0100 |
commit | 902bf05879a89f7c296992da648eef9d1ea598d3 (patch) | |
tree | c33b73a4a3364b8b284f04beac89b6c4a517f6f9 /lib/system | |
parent | 2fb8ced454fd36d7299e208c39052de91ce2c4ff (diff) | |
download | Nim-902bf05879a89f7c296992da648eef9d1ea598d3.tar.gz |
commit before ov-res changes
Diffstat (limited to 'lib/system')
-rwxr-xr-x | lib/system/systhread.nim | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/lib/system/systhread.nim b/lib/system/systhread.nim index 82ffd72ce..70447f288 100755 --- a/lib/system/systhread.nim +++ b/lib/system/systhread.nim @@ -48,6 +48,7 @@ proc atomicDec(memLoc: var int, x: int): int = when defined(Windows): type THandle = int + TSysThread = THandle TSysLock {.final, pure.} = object # CRITICAL_SECTION in WinApi DebugInfo: pointer LockCount: int32 @@ -83,13 +84,31 @@ else: type - TThread* {.final, pure.} = object - id: int - next: ptr TThread + TThread* = TSysThread + TLock* = TSysLock TThreadFunc* = proc (closure: pointer) {.cdecl.} -proc createThread*(t: var TThread, fn: TThreadFunc) = +DWORD WINAPI SuspendThread( + __in HANDLE hThread +); +DWORD WINAPI ResumeThread( + __in HANDLE hThread +); +DWORD WINAPI ThreadProc( + __in LPVOID lpParameter +); + +proc createThread*(t: var TThread, fn: TThreadFunc, closure: pointer) = + when defined(windows): + + else: + nil + #pthread_create( + +proc joinThread*(t: TThread) = nil + +#proc pthread_exit(void *value_ptr) proc destroyThread*(t: var TThread) = nil |