Browse Source

Removed support for the collector for WinCE again as WinCE does not support DuplicateHandle which is needed for the collector.

git-svn-id: branches/svenbarth/collector@17274 -
svenbarth 14 years ago
parent
commit
6a23c1f511
2 changed files with 21 additions and 10 deletions
  1. 21 9
      rtl/win/systhrd.inc
  2. 0 1
      rtl/wince/system.pp

+ 21 - 9
rtl/win/systhrd.inc

@@ -49,15 +49,10 @@ function  WinResumeThread  (threadHandle : THandle) : dword; {$ifdef wince}cdecl
 function  WinCloseHandle  (threadHandle : THandle) : dword; {$ifdef wince}cdecl{$else}stdcall{$endif};external KernelDLL name 'CloseHandle';
 function  WinCloseHandle  (threadHandle : THandle) : dword; {$ifdef wince}cdecl{$else}stdcall{$endif};external KernelDLL name 'CloseHandle';
 function  TerminateThread  (threadHandle : THandle; var exitCode : dword) : boolean; {$ifdef wince}cdecl{$else}stdcall{$endif};external KernelDLL name 'TerminateThread';
 function  TerminateThread  (threadHandle : THandle; var exitCode : dword) : boolean; {$ifdef wince}cdecl{$else}stdcall{$endif};external KernelDLL name 'TerminateThread';
 function  WaitForSingleObject (hHandle : THandle;Milliseconds: dword): dword; {$ifdef wince}cdecl{$else}stdcall{$endif};external KernelDLL name 'WaitForSingleObject';
 function  WaitForSingleObject (hHandle : THandle;Milliseconds: dword): dword; {$ifdef wince}cdecl{$else}stdcall{$endif};external KernelDLL name 'WaitForSingleObject';
-{$ifdef wince}
-function GetCurrentThread: THandle;
-begin
-  GetCurrentThread := SH_CURTHREAD + SYS_HANDLE_BASE;
-end;
-{$else}
+{$ifndef wince}
 function GetCurrentThread: THandle; external KernelDLL name 'GetCurrentThread';
 function GetCurrentThread: THandle; external KernelDLL name 'GetCurrentThread';
-{$endif}
 function  DuplicateHandle (hSourceProcessHandle : THandle; hSourceHandle : THandle; hTargetProcessHandle : THandle; var lpTargetHandle : THandle; dwDesiredAccess : dword; bInheritHandle : longbool; dwOptions : dword) : longbool;{$ifdef wince}cdecl{$else}stdcall{$endif}; external KernelDLL name 'DuplicateHandle';
 function  DuplicateHandle (hSourceProcessHandle : THandle; hSourceHandle : THandle; hTargetProcessHandle : THandle; var lpTargetHandle : THandle; dwDesiredAccess : dword; bInheritHandle : longbool; dwOptions : dword) : longbool;{$ifdef wince}cdecl{$else}stdcall{$endif}; external KernelDLL name 'DuplicateHandle';
+{$endif}
 function  WinThreadSetPriority (threadHandle : THandle; Prio: longint): boolean; {$ifdef wince}cdecl{$else}stdcall{$endif};external KernelDLL name 'SetThreadPriority';
 function  WinThreadSetPriority (threadHandle : THandle; Prio: longint): boolean; {$ifdef wince}cdecl{$else}stdcall{$endif};external KernelDLL name 'SetThreadPriority';
 function  WinThreadGetPriority (threadHandle : THandle): LongInt; {$ifdef wince}cdecl{$else}stdcall{$endif};external KernelDLL name 'GetThreadPriority';
 function  WinThreadGetPriority (threadHandle : THandle): LongInt; {$ifdef wince}cdecl{$else}stdcall{$endif};external KernelDLL name 'GetThreadPriority';
 {$ifndef WINCE}
 {$ifndef WINCE}
@@ -85,7 +80,9 @@ CONST
    WAIT_IO_COMPLETION = $c0;
    WAIT_IO_COMPLETION = $c0;
    WAIT_ABANDONED = $80;
    WAIT_ABANDONED = $80;
    WAIT_FAILED = $ffffffff;
    WAIT_FAILED = $ffffffff;
+{$ifndef wince}
    DUPLICATE_SAME_ACCESS = $00000002;
    DUPLICATE_SAME_ACCESS = $00000002;
+{$endif}
 
 
 {$ifndef SUPPORT_WIN95}
 {$ifndef SUPPORT_WIN95}
 function WinTryEnterCriticalSection(var cs : TRTLCriticalSection):longint;
 function WinTryEnterCriticalSection(var cs : TRTLCriticalSection):longint;
@@ -97,6 +94,7 @@ var
   WinTryEnterCriticalSection : TTryEnterCriticalSection;
   WinTryEnterCriticalSection : TTryEnterCriticalSection;
 {$endif SUPPORT_WIN95}
 {$endif SUPPORT_WIN95}
 
 
+{$ifndef wince}
 {*****************************************************************************
 {*****************************************************************************
                          external Threads support
                          external Threads support
 *****************************************************************************}
 *****************************************************************************}
@@ -333,6 +331,7 @@ var
       ExternalThreadsList := entry;
       ExternalThreadsList := entry;
       SysLeaveCriticalSection(ExternalThreadLock);
       SysLeaveCriticalSection(ExternalThreadLock);
     end;
     end;
+{$endif}
 
 
 {*****************************************************************************
 {*****************************************************************************
                              Threadvar support
                              Threadvar support
@@ -401,7 +400,9 @@ var
       var
       var
         dataindex : pointer;
         dataindex : pointer;
         errorsave : dword;
         errorsave : dword;
+{$ifndef wince}
         usecs : Boolean;
         usecs : Boolean;
+{$endif}
       begin
       begin
 {$ifdef dummy}
 {$ifdef dummy}
         { it least in the on windows 7 x64, this still doesn't not work, fs:(0x2c) is
         { it least in the on windows 7 x64, this still doesn't not work, fs:(0x2c) is
@@ -429,6 +430,7 @@ var
             SetLastError(errorsave);
             SetLastError(errorsave);
           end;
           end;
 {$else win32}
 {$else win32}
+{$ifndef wince}
         { once external threads have been detected we have to use the
         { once external threads have been detected we have to use the
           FakeProtection critical section, so that only the collector will
           FakeProtection critical section, so that only the collector will
           access FakeThreadVars }
           access FakeThreadVars }
@@ -471,7 +473,8 @@ var
         end;
         end;
         if usecs then
         if usecs then
           SysLeaveCriticalSection(FakeProtection);
           SysLeaveCriticalSection(FakeProtection);
-{        errorsave:=GetLastError;
+{$else}
+        errorsave:=GetLastError;
         dataindex:=TlsGetValue(tlskey);
         dataindex:=TlsGetValue(tlskey);
         if dataindex=nil then
         if dataindex=nil then
           begin
           begin
@@ -479,7 +482,8 @@ var
             dataindex:=TlsGetValue(tlskey);
             dataindex:=TlsGetValue(tlskey);
             InitThread($1000000);
             InitThread($1000000);
           end;
           end;
-        SetLastError(errorsave);}
+        SetLastError(errorsave);
+{$endif}
 {$endif win32}
 {$endif win32}
         SysRelocateThreadvar:=DataIndex+Offset;
         SysRelocateThreadvar:=DataIndex+Offset;
       end;
       end;
@@ -487,13 +491,17 @@ var
 
 
     procedure SysReleaseThreadVars;
     procedure SysReleaseThreadVars;
       begin
       begin
+{$ifndef wince}
         if ExternalThreadsDetected and (FakeThreadVars <> nil) then
         if ExternalThreadsDetected and (FakeThreadVars <> nil) then
           { finally free the memory area }
           { finally free the memory area }
           LocalFree(FakeThreadVars)
           LocalFree(FakeThreadVars)
         else begin
         else begin
+{$endif}
           LocalFree(TlsGetValue(tlskey));
           LocalFree(TlsGetValue(tlskey));
           TlsSetValue(tlskey, nil);
           TlsSetValue(tlskey, nil);
+{$ifndef wince}
         end;
         end;
+{$endif}
       end;
       end;
 
 
 
 
@@ -839,7 +847,9 @@ begin
   ThreadID := GetCurrentThreadID;
   ThreadID := GetCurrentThreadID;
   if IsLibrary then
   if IsLibrary then
     SysInitMultithreading;
     SysInitMultithreading;
+{$ifndef wince}
   SysInitCriticalSection(RegisterExternalLock);
   SysInitCriticalSection(RegisterExternalLock);
+{$endif}
 {$IFDEF SUPPORT_WIN95}
 {$IFDEF SUPPORT_WIN95}
   { Try to find TryEnterCriticalSection function }
   { Try to find TryEnterCriticalSection function }
   KernelHandle:=LoadLibrary(KernelDLL);
   KernelHandle:=LoadLibrary(KernelDLL);
@@ -853,8 +863,10 @@ begin
 {$ENDIF SUPPORT_WIN95}
 {$ENDIF SUPPORT_WIN95}
 end;
 end;
 
 
+{$ifndef wince}
 procedure FiniSystemThreads;
 procedure FiniSystemThreads;
 begin
 begin
   TerminateCollector := True;
   TerminateCollector := True;
 end;
 end;
+{$endif}
 
 

+ 0 - 1
rtl/wince/system.pp

@@ -813,7 +813,6 @@ Procedure system_exit;
 begin
 begin
   if IsLibrary then
   if IsLibrary then
     exit;
     exit;
-  FiniSystemThreads;
   if not IsConsole then
   if not IsConsole then
     begin
     begin
       Close(stderr);
       Close(stderr);