From ef669a31c8e50e62240e86558818159b211fd0fd Mon Sep 17 00:00:00 2001
From: Tomas Hajny <hajny@freepascal.org>
Date: Sun, 11 Apr 2010 15:14:18 +0000
Subject: [PATCH]   * initialize previously missing fields of threadmanager
 record

git-svn-id: trunk@15139 -
---
 rtl/os2/systhrd.inc | 33 +++++++++++++++++++++++++++++----
 1 file changed, 29 insertions(+), 4 deletions(-)

diff --git a/rtl/os2/systhrd.inc b/rtl/os2/systhrd.inc
index b6d99a93e0..5068b204e1 100644
--- a/rtl/os2/systhrd.inc
+++ b/rtl/os2/systhrd.inc
@@ -425,9 +425,8 @@ begin
 end;
 
 
-CONST INFINITE=-1;
-
 procedure IntRTLEventWaitFor (AEvent: PRTLEvent);
+CONST INFINITE=-1;
 begin
 {$WARNING TODO!}
 {
@@ -436,6 +435,30 @@ begin
 end;
 
 
+function SysTryEnterCriticalSection (var CS): longint;
+begin
+{$WARNING TODO!}
+end;
+
+
+procedure IntRTLEventWaitForTimeout (AEvent: PRTLEvent; Timeout: longint);
+begin
+{$WARNING TODO!}
+{
+  WaitForSingleObject(THANDLE(AEvent), Timeout);
+}
+end;
+
+
+procedure intRTLEventResetEvent (AEvent: PRTLEvent);
+begin
+{$WARNING TODO!}
+{
+  ResetEvent(THANDLE(AEvent));
+}
+end;
+
+
 
 var
   OS2ThreadManager: TThreadManager;
@@ -453,14 +476,15 @@ begin
     ResumeThread           :=@SysResumeThread;
     KillThread             :=@SysKillThread;
     ThreadSwitch           :=@SysThreadSwitch;
+    CloseThread		   :=@SysCloseThread;
     WaitForThreadTerminate :=@SysWaitForThreadTerminate;
     ThreadSetPriority      :=@SysThreadSetPriority;
     ThreadGetPriority      :=@SysThreadGetPriority;
-    CloseThread		   :=@SysCloseThread;
     GetCurrentThreadId     :=@SysGetCurrentThreadId;
     InitCriticalSection    :=@SysInitCriticalSection;
     DoneCriticalSection    :=@SysDoneCriticalSection;
     EnterCriticalSection   :=@SysEnterCriticalSection;
+    TryEnterCriticalSection:=@SysTryEnterCriticalSection;
     LeaveCriticalSection   :=@SysLeaveCriticalSection;
     InitThreadVar          :=@SysInitThreadVar;
     RelocateThreadVar      :=@SysRelocateThreadVar;
@@ -474,9 +498,10 @@ begin
     RTLEventCreate         :=@IntRTLEventCreate;
     RTLEventDestroy        :=@IntRTLEventDestroy;
     RTLEventSetEvent       :=@IntRTLEventSetEvent;
+    RTLEventResetEvent     :=@intRTLEventResetEvent;
     RTLEventWaitFor        :=@IntRTLEventWaitFor;
+    RTLEventWaitForTimeout :=@intRTLEventWaitForTimeout;
     end;
   SetThreadManager (OS2ThreadManager);
 end;
 
-