summary refs log tree commit diff stats
path: root/lib/system
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2010-12-07 17:11:35 +0100
committerAraq <rumpf_a@web.de>2010-12-07 17:11:35 +0100
commit902bf05879a89f7c296992da648eef9d1ea598d3 (patch)
treec33b73a4a3364b8b284f04beac89b6c4a517f6f9 /lib/system
parent2fb8ced454fd36d7299e208c39052de91ce2c4ff (diff)
downloadNim-902bf05879a89f7c296992da648eef9d1ea598d3.tar.gz
commit before ov-res changes
Diffstat (limited to 'lib/system')
-rwxr-xr-xlib/system/systhread.nim27
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