From 859bb30daa05bb3d8d41c2bbfedb85b73431975f Mon Sep 17 00:00:00 2001 From: michael Date: Thu, 9 Jun 2005 17:40:29 +0000 Subject: [PATCH] + Removed HASTHREADVAR SUPPORT_THREADVAR defines git-svn-id: trunk@295 - --- rtl/emx/dos.pas | 8 -------- rtl/emx/system.pas | 4 ---- rtl/emx/systhrd.inc | 2 -- rtl/inc/crt.inc | 4 ---- rtl/inc/dos.inc | 4 ---- rtl/inc/dosh.inc | 4 ---- rtl/inc/except.inc | 5 +---- rtl/inc/systemh.inc | 7 ------- rtl/inc/threadh.inc | 2 -- rtl/inc/threadvr.inc | 2 -- rtl/netware/systhrd.inc | 10 ---------- rtl/netwlibc/systhrd.inc | 12 ------------ rtl/os2/crt.pas | 6 +----- rtl/os2/dos.pas | 8 -------- rtl/os2/system.pas | 4 ---- rtl/os2/systhrd.inc | 10 ---------- rtl/unix/cthreads.pp | 10 ---------- rtl/win/systhrd.inc | 10 ---------- 18 files changed, 2 insertions(+), 110 deletions(-) diff --git a/rtl/emx/dos.pas b/rtl/emx/dos.pas index 4ba4c005ee..1823527e98 100644 --- a/rtl/emx/dos.pas +++ b/rtl/emx/dos.pas @@ -101,11 +101,7 @@ const function GetEnvPChar (EnvVar: string): PChar; -{$ifdef HASTHREADVAR} threadvar -{$else HASTHREADVAR} -var -{$endif HASTHREADVAR} (* For compatibility with VP/2, used for runflags in Exec procedure. *) ExecFlags: cardinal; @@ -126,11 +122,7 @@ const {$I dos.inc} -{$ifdef HASTHREADVAR} threadvar -{$else HASTHREADVAR} -var -{$endif HASTHREADVAR} LastSR: SearchRec; var diff --git a/rtl/emx/system.pas b/rtl/emx/system.pas index 5aea2e4881..b3cff33097 100644 --- a/rtl/emx/system.pas +++ b/rtl/emx/system.pas @@ -416,11 +416,7 @@ begin end; -{$ifdef HASTHREADVAR} threadvar -{$else HASTHREADVAR} -var -{$endif HASTHREADVAR} DefaultCreator: ShortString; DefaultFileType: ShortString; diff --git a/rtl/emx/systhrd.inc b/rtl/emx/systhrd.inc index 829fe8e487..c6d7d8fdd8 100644 --- a/rtl/emx/systhrd.inc +++ b/rtl/emx/systhrd.inc @@ -74,7 +74,6 @@ function DosExitCritSec:cardinal; cdecl; external 'DOSCALLS' index 233; Threadvar support *****************************************************************************} -{$ifdef HASTHREADVAR} const ThreadVarBlockSize: dword = 0; @@ -128,7 +127,6 @@ end; fpc_threadvar_relocate_proc := @SysRelocateThreadvar; end; -{$endif HASTHREADVAR} {***************************************************************************** diff --git a/rtl/inc/crt.inc b/rtl/inc/crt.inc index df0777098e..cf0dfc9623 100644 --- a/rtl/inc/crt.inc +++ b/rtl/inc/crt.inc @@ -196,11 +196,7 @@ begin end; -{$ifdef HASTHREADVAR} threadvar -{$else HASTHREADVAR} -var -{$endif HASTHREADVAR} CurrX, CurrY: dword; diff --git a/rtl/inc/dos.inc b/rtl/inc/dos.inc index 6872413441..ea92bb8fa5 100644 --- a/rtl/inc/dos.inc +++ b/rtl/inc/dos.inc @@ -21,11 +21,7 @@ const ExtensionSeparator = '.'; {$IFNDEF HAS_DOSEXITCODE} - {$IFDEF HASTHREADVAR} threadvar - {$ELSE HASTHREADVAR} -var - {$ENDIF HASTHREADVAR} LastDosExitCode: longint; function DosExitCode: word; diff --git a/rtl/inc/dosh.inc b/rtl/inc/dosh.inc index edb5d5aaff..ae0ccd7ab2 100644 --- a/rtl/inc/dosh.inc +++ b/rtl/inc/dosh.inc @@ -81,11 +81,7 @@ Type Sec : word; End; -{$ifdef HASTHREADVAR} threadvar -{$else HASTHREADVAR} -var -{$endif HASTHREADVAR} DosError : integer; {$ifdef cpui386} diff --git a/rtl/inc/except.inc b/rtl/inc/except.inc index bc3f295140..2c84af964f 100644 --- a/rtl/inc/except.inc +++ b/rtl/inc/except.inc @@ -37,11 +37,8 @@ Type Const CatchAllExceptions : PtrInt = -1; -{$ifdef SUPPORT_THREADVAR} + ThreadVar -{$else SUPPORT_THREADVAR} -Var -{$endif SUPPORT_THREADVAR} ExceptAddrStack : PExceptAddr; ExceptObjectStack : PExceptObject; diff --git a/rtl/inc/systemh.inc b/rtl/inc/systemh.inc index 8dd2cccc08..d0e7f5f78a 100644 --- a/rtl/inc/systemh.inc +++ b/rtl/inc/systemh.inc @@ -28,9 +28,6 @@ {$endif} { Use threadvars when the compiler supports it } -{$ifdef HASTHREADVAR} - {$define SUPPORT_THREADVAR} -{$endif HASTHREADVAR} { don't use FPU registervariables on the i386 } {$ifdef CPUI386} @@ -352,11 +349,7 @@ var { Threading support } fpc_threadvar_relocate_proc : pointer; public name 'FPC_THREADVAR_RELOCATE'; -{$ifdef SUPPORT_THREADVAR} ThreadVar -{$else SUPPORT_THREADVAR} -Var -{$endif SUPPORT_THREADVAR} ThreadID : TThreadID; { Standard In- and Output } ErrOutput, diff --git a/rtl/inc/threadh.inc b/rtl/inc/threadh.inc index 9e244efbeb..deb71199fd 100644 --- a/rtl/inc/threadh.inc +++ b/rtl/inc/threadh.inc @@ -96,9 +96,7 @@ Function SetThreadManager(Const NewTM : TThreadManager) : Boolean; Procedure SetNoThreadManager; {$endif DISABLE_NO_THREAD_MANAGER} // Needs to be exported, so the manager can call it. -{$ifdef HASTHREADVAR} procedure InitThreadVars(RelocProc : Pointer); -{$endif HASTHREADVAR} procedure InitThread(stklen:cardinal); {***************************************************************************** diff --git a/rtl/inc/threadvr.inc b/rtl/inc/threadvr.inc index aa6fa0cf81..fc7e68cd27 100644 --- a/rtl/inc/threadvr.inc +++ b/rtl/inc/threadvr.inc @@ -19,7 +19,6 @@ Threadvar support *****************************************************************************} -{$ifdef HASTHREADVAR} type pltvInitEntry = ^ltvInitEntry; @@ -97,5 +96,4 @@ begin fpc_threadvar_relocate_proc:=RelocProc; end; -{$endif HASTHREADVAR} diff --git a/rtl/netware/systhrd.inc b/rtl/netware/systhrd.inc index d102da2569..8be3bf0a61 100644 --- a/rtl/netware/systhrd.inc +++ b/rtl/netware/systhrd.inc @@ -31,7 +31,6 @@ Threadvar support *****************************************************************************} -{$ifdef HASTHREADVAR} const threadvarblocksize : dword = 0; // total size of allocated threadvars @@ -106,7 +105,6 @@ begin end; end; -{$endif HASTHREADVAR} {***************************************************************************** @@ -127,9 +125,7 @@ procedure DoneThread; begin { release thread vars } -{$ifdef HASTHREADVAR} SysReleaseThreadVars; -{$endif} end; @@ -139,11 +135,9 @@ function ThreadMain(param : pointer) : dword; cdecl; ti : tthreadinfo; begin -{$ifdef HASTHREADVAR} { Allocate local thread vars, this must be the first thing, because the exception management and io depends on threadvars } SysAllocateThreadVars; -{$endif HASTHREADVAR} {$ifdef DEBUG_MT} ConsolePrintf(#13'New thread %x started, initialising ...'#13#10,_GetThreadID); {$endif DEBUG_MT} @@ -167,13 +161,11 @@ function SysBeginThread(sa : Pointer;stacksize : dword; {$ifdef DEBUG_MT} ConsolePrintf(#13'Creating new thread'#13#10); {$endif DEBUG_MT} -{$ifdef HASTHREADVAR} if not IsMultiThread then begin InitThreadVars(@SysRelocateThreadvar); IsMultithread:=true; end; -{$endif} { the only way to pass data to the newly created thread } { in a MT safe way, is to use the heap } new(ti); @@ -472,12 +464,10 @@ begin DoneCriticalSection :=@SysDoneCriticalSection; EnterCriticalSection :=@SysEnterCriticalSection; LeaveCriticalSection :=@SysLeaveCriticalSection; -{$ifdef HASTHREADVAR} InitThreadVar :=@SysInitThreadVar; RelocateThreadVar :=@SysRelocateThreadVar; AllocateThreadVars :=@SysAllocateThreadVars; ReleaseThreadVars :=@SysReleaseThreadVars; -{$endif HASTHREADVAR} BasicEventCreate :=@NoBasicEventCreate; basiceventdestroy :=@Nobasiceventdestroy; basiceventResetEvent :=@NobasiceventResetEvent; diff --git a/rtl/netwlibc/systhrd.inc b/rtl/netwlibc/systhrd.inc index 909ffd22df..46aad8c17a 100644 --- a/rtl/netwlibc/systhrd.inc +++ b/rtl/netwlibc/systhrd.inc @@ -27,7 +27,6 @@ Threadvar support *****************************************************************************} -{$ifdef HASTHREADVAR} const threadvarblocksize : dword = 0; thredvarsmainthread: pointer = nil; // to free the threadvars in the signal handler @@ -82,7 +81,6 @@ pthread_setspecific(tlskey,newPtr); end; -{$endif HASTHREADVAR} {***************************************************************************** @@ -100,10 +98,8 @@ procedure DoneThread; begin { Release Threadvars } -{$ifdef HASTHREADVAR} WRITE_DEBUG('DoneThread, releasing threadvars'#13#10); SysReleaseThreadVars; -{$endif HASTHREADVAR} end; @@ -112,11 +108,9 @@ ti : tthreadinfo; begin WRITE_DEBUG('New thread started, initing threadvars'#13#10); -{$ifdef HASTHREADVAR} { Allocate local thread vars, this must be the first thing, because the exception management and io depends on threadvars } SysAllocateThreadVars; -{$endif HASTHREADVAR} { Copy parameter to local data } WRITE_DEBUG('New thread started, initialising ...'#13#10); ti:=pthreadinfo(param)^; @@ -143,11 +137,9 @@ { Initialize multithreading if not done } if not IsMultiThread then begin -{$ifdef HASTHREADVAR} { We're still running in single thread mode, setup the TLS } pthread_key_create(@TLSKey,nil); InitThreadVars(@SysRelocateThreadvar); -{$endif HASTHREADVAR} IsMultiThread:=true; end; { the only way to pass data to the newly created thread @@ -423,12 +415,10 @@ begin DoneCriticalSection :=@SysDoneCriticalSection; EnterCriticalSection :=@SysEnterCriticalSection; LeaveCriticalSection :=@SysLeaveCriticalSection; -{$ifdef hasthreadvar} InitThreadVar :=@SysInitThreadVar; RelocateThreadVar :=@SysRelocateThreadVar; AllocateThreadVars :=@SysAllocateThreadVars; ReleaseThreadVars :=@SysReleaseThreadVars; -{$endif} BasicEventCreate :=@intBasicEventCreate; BasicEventDestroy :=@intBasicEventDestroy; BasicEventResetEvent :=@intBasicEventResetEvent; @@ -437,9 +427,7 @@ begin end; SetThreadManager(NWThreadManager); InitHeapMutexes; - {$ifdef HASTHREADVAR} ThVarAllocResourceTag := AllocateResourceTag(getnlmhandle,'Threadvar Memory',AllocSignature); - {$endif} NWSysSetThreadFunctions (@SysAllocateThreadVars, @SysReleaseThreadVars, @SysSetThreadDataAreaPtr); diff --git a/rtl/os2/crt.pas b/rtl/os2/crt.pas index 8f200ef9a8..8e7105cab7 100644 --- a/rtl/os2/crt.pas +++ b/rtl/os2/crt.pas @@ -131,12 +131,8 @@ external 'DOSCALLS' index 286; -{$ifdef HASTHREADVAR} threadvar -{$else HASTHREADVAR} -var -{$endif HASTHREADVAR} - ExtKeyCode: char; + ExtKeyCode: char; diff --git a/rtl/os2/dos.pas b/rtl/os2/dos.pas index fcb0467b83..95688c6f79 100644 --- a/rtl/os2/dos.pas +++ b/rtl/os2/dos.pas @@ -51,11 +51,7 @@ Type {Flags for the exec procedure: } -{$ifdef HASTHREADVAR} threadvar -{$else HASTHREADVAR} -var -{$endif HASTHREADVAR} (* For compatibility with VP/2, used for runflags in Exec procedure. *) ExecFlags: cardinal; @@ -81,11 +77,7 @@ implementation {$I dos.inc} -{$ifdef HASTHREADVAR} threadvar -{$else HASTHREADVAR} -var -{$endif HASTHREADVAR} LastDosErrorModuleName: string; diff --git a/rtl/os2/system.pas b/rtl/os2/system.pas index ae5d6b9502..0eadfaf809 100644 --- a/rtl/os2/system.pas +++ b/rtl/os2/system.pas @@ -417,11 +417,7 @@ asm end; -{$ifdef HASTHREADVAR} threadvar -{$else HASTHREADVAR} -var -{$endif HASTHREADVAR} DefaultCreator: ShortString; DefaultFileType: ShortString; diff --git a/rtl/os2/systhrd.inc b/rtl/os2/systhrd.inc index 3e510301a1..756a480859 100644 --- a/rtl/os2/systhrd.inc +++ b/rtl/os2/systhrd.inc @@ -70,7 +70,6 @@ procedure DosSleep (MSec: cardinal); cdecl; external 'DOSCALLS' index 229; Threadvar support *****************************************************************************} -{$ifdef HASTHREADVAR} const ThreadVarBlockSize: dword = 0; @@ -124,7 +123,6 @@ end; fpc_threadvar_relocate_proc := @SysRelocateThreadvar; end; *) -{$endif HASTHREADVAR} {***************************************************************************** @@ -159,9 +157,7 @@ end; procedure DoneThread; begin { Release Threadvars } -{$ifdef HASTHREADVAR} SysReleaseThreadVars; -{$endif HASTHREADVAR} end; @@ -169,11 +165,9 @@ end; var ti : tthreadinfo; begin -{$ifdef HASTHREADVAR} { Allocate local thread vars, this must be the first thing, because the exception management and io depends on threadvars } SysAllocateThreadVars; -{$endif HASTHREADVAR} { Copy parameter to local data } {$ifdef DEBUG_MT} writeln('New thread started, initialising ...'); @@ -202,11 +196,9 @@ end; { Initialize multithreading if not done } if not IsMultiThread then begin -{$ifdef HASTHREADVAR} if DosAllocThreadLocalMemory (1, DataIndex) <> 0 then RunError (8); InitThreadVars(@SysRelocateThreadVar); -{$endif HASTHREADVAR} IsMultiThread:=true; end; { the only way to pass data to the newly created thread @@ -521,12 +513,10 @@ begin DoneCriticalSection :=@SysDoneCriticalSection; EnterCriticalSection :=@SysEnterCriticalSection; LeaveCriticalSection :=@SysLeaveCriticalSection; -{$ifdef HASTHREADVAR} InitThreadVar :=@SysInitThreadVar; RelocateThreadVar :=@SysRelocateThreadVar; AllocateThreadVars :=@SysAllocateThreadVars; ReleaseThreadVars :=@SysReleaseThreadVars; -{$endif HASTHREADVAR} BasicEventCreate :=@IntBasicEventCreate; BasicEventDestroy :=@IntBasicEventDestroy; BasicEventResetEvent :=@IntBasicEventResetEvent; diff --git a/rtl/unix/cthreads.pp b/rtl/unix/cthreads.pp index 7cd226c1cb..3996c78d7c 100644 --- a/rtl/unix/cthreads.pp +++ b/rtl/unix/cthreads.pp @@ -60,7 +60,6 @@ Type PINTRTLEvent = ^TINTRTLEvent; Threadvar support *****************************************************************************} -{$ifdef HASTHREADVAR} const threadvarblocksize : dword = 0; @@ -127,7 +126,6 @@ Type PINTRTLEvent = ^TINTRTLEvent; { Include OS independent Threadvar initialization } -{$endif HASTHREADVAR} {***************************************************************************** @@ -145,9 +143,7 @@ Type PINTRTLEvent = ^TINTRTLEvent; procedure DoneThread; begin { Release Threadvars } -{$ifdef HASTHREADVAR} CReleaseThreadVars; -{$endif HASTHREADVAR} end; @@ -168,11 +164,9 @@ Type PINTRTLEvent = ^TINTRTLEvent; s := 'New thread started, initing threadvars'#10; fpwrite(0,s[1],length(s)); {$endif DEBUG_MT} -{$ifdef HASTHREADVAR} { Allocate local thread vars, this must be the first thing, because the exception management and io depends on threadvars } CAllocateThreadVars; -{$endif HASTHREADVAR} { Copy parameter to local data } {$ifdef DEBUG_MT} s := 'New thread started, initialising ...'#10; @@ -205,11 +199,9 @@ Type PINTRTLEvent = ^TINTRTLEvent; { Initialize multithreading if not done } if not IsMultiThread then begin -{$ifdef HASTHREADVAR} { We're still running in single thread mode, setup the TLS } pthread_key_create(@TLSKey,nil); InitThreadVars(@CRelocateThreadvar); -{$endif HASTHREADVAR} IsMultiThread:=true; end; { the only way to pass data to the newly created thread @@ -619,12 +611,10 @@ begin DoneCriticalSection :=@CDoneCriticalSection; EnterCriticalSection :=@CEnterCriticalSection; LeaveCriticalSection :=@CLeaveCriticalSection; -{$ifdef hasthreadvar} InitThreadVar :=@CInitThreadVar; RelocateThreadVar :=@CRelocateThreadVar; AllocateThreadVars :=@CAllocateThreadVars; ReleaseThreadVars :=@CReleaseThreadVars; -{$endif} BasicEventCreate :=@intBasicEventCreate; BasicEventDestroy :=@intBasicEventDestroy; BasicEventResetEvent :=@intBasicEventResetEvent; diff --git a/rtl/win/systhrd.inc b/rtl/win/systhrd.inc index e94362b00c..112d7575c6 100644 --- a/rtl/win/systhrd.inc +++ b/rtl/win/systhrd.inc @@ -66,7 +66,6 @@ CONST Threadvar support *****************************************************************************} -{$ifdef HASTHREADVAR} const threadvarblocksize : dword = 0; @@ -105,7 +104,6 @@ CONST GlobalFree(TlsGetValue(tlskey)); end; -{$endif HASTHREADVAR} {***************************************************************************** @@ -123,9 +121,7 @@ CONST procedure DoneThread; begin { Release Threadvars } -{$ifdef HASTHREADVAR} SysReleaseThreadVars; -{$endif HASTHREADVAR} end; @@ -133,11 +129,9 @@ CONST var ti : tthreadinfo; begin -{$ifdef HASTHREADVAR} { Allocate local thread vars, this must be the first thing, because the exception management and io depends on threadvars } SysAllocateThreadVars; -{$endif HASTHREADVAR} { Copy parameter to local data } {$ifdef DEBUG_MT} writeln('New thread started, initialising ...'); @@ -167,11 +161,9 @@ CONST { Initialize multithreading if not done } if not IsMultiThread then begin -{$ifdef HASTHREADVAR} { We're still running in single thread mode, setup the TLS } TLSKey:=TlsAlloc; InitThreadVars(@SysRelocateThreadvar); -{$endif HASTHREADVAR} IsMultiThread:=true; end; { the only way to pass data to the newly created thread @@ -447,12 +439,10 @@ begin DoneCriticalSection :=@SysDoneCriticalSection; EnterCriticalSection :=@SysEnterCriticalSection; LeaveCriticalSection :=@SysLeaveCriticalSection; -{$ifdef HASTHREADVAR} InitThreadVar :=@SysInitThreadVar; RelocateThreadVar :=@SysRelocateThreadVar; AllocateThreadVars :=@SysAllocateThreadVars; ReleaseThreadVars :=@SysReleaseThreadVars; -{$endif HASTHREADVAR} BasicEventCreate :=@intBasicEventCreate; BasicEventDestroy :=@intBasicEventDestroy; BasicEventResetEvent :=@intBasicEventResetEvent;