浏览代码

+ Renamed thread unit to systhrds

michael 23 年之前
父节点
当前提交
39f16b03ef
共有 4 个文件被更改,包括 27 次插入49 次删除
  1. 5 2
      compiler/pmodules.pas
  2. 4 3
      rtl/win32/Makefile
  3. 3 1
      rtl/win32/Makefile.fpc
  4. 15 43
      rtl/win32/systhrds.pp

+ 5 - 2
compiler/pmodules.pas

@@ -436,7 +436,7 @@ implementation
       { Thread support unit? }
       { Thread support unit? }
         if (cs_threading in aktmoduleswitches) then
         if (cs_threading in aktmoduleswitches) then
          begin
          begin
-           hp:=loadunit('Threads','');
+           hp:=loadunit('systhrds','');
            tsymtable(hp.globalsymtable).next:=symtablestack;
            tsymtable(hp.globalsymtable).next:=symtablestack;
            symtablestack:=hp.globalsymtable;
            symtablestack:=hp.globalsymtable;
            { add to the used units }
            { add to the used units }
@@ -1433,7 +1433,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.81  2002-10-14 19:42:34  peter
+  Revision 1.82  2002-10-16 06:32:52  michael
+  + Renamed thread unit to systhrds
+
+  Revision 1.81  2002/10/14 19:42:34  peter
     * only use init tables for threadvars
     * only use init tables for threadvars
 
 
   Revision 1.80  2002/10/06 19:41:30  peter
   Revision 1.80  2002/10/06 19:41:30  peter

+ 4 - 3
rtl/win32/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/10/07]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/10/05]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx netware openbsd wdosx
+MAKEFILETARGETS=win32
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -234,7 +234,7 @@ OBJPASDIR=$(RTL)/objpas
 GRAPHDIR=$(INC)/graph
 GRAPHDIR=$(INC)/graph
 include $(WININC)/makefile.inc
 include $(WININC)/makefile.inc
 WINDOWS_SOURCE_FILES=$(addprefix $(WININC)/,$(addsuffix .inc,$(WINDOWS_FILES)))
 WINDOWS_SOURCE_FILES=$(addprefix $(WININC)/,$(addsuffix .inc,$(WINDOWS_FILES)))
-override TARGET_UNITS+=$(SYSTEMUNIT) threads objpas strings lineinfo heaptrc windows ole2 activex opengl32 winsock initc dos crt objects graph messages sysutils typinfo math varutils variants cpu mmx charset ucomplex getopts wincrt winmouse winevent sockets printer dynlibs video mouse keyboard types comobj
+override TARGET_UNITS+=$(SYSTEMUNIT) systhrds objpas strings lineinfo heaptrc windows ole2 activex opengl32 winsock initc dos crt objects graph messages sysutils typinfo math varutils variants cpu mmx charset ucomplex getopts wincrt winmouse winevent sockets printer dynlibs video mouse keyboard types comobj
 override TARGET_LOADERS+=wprt0 wdllprt0
 override TARGET_LOADERS+=wprt0 wdllprt0
 override TARGET_RSTS+=math varutils typinfo
 override TARGET_RSTS+=math varutils typinfo
 override INSTALL_FPCPACKAGE=y
 override INSTALL_FPCPACKAGE=y
@@ -1208,6 +1208,7 @@ wdllprt0$(OEXT) : wdllprt0.as
 	$(AS) -o wdllprt0$(OEXT) wdllprt0.as
 	$(AS) -o wdllprt0$(OEXT) wdllprt0.as
 $(SYSTEMUNIT)$(PPUEXT) : $(SYSTEMUNIT).pp win32.inc $(SYSDEPS)
 $(SYSTEMUNIT)$(PPUEXT) : $(SYSTEMUNIT).pp win32.inc $(SYSDEPS)
 	$(COMPILER) -Us -Sg $(SYSTEMUNIT).pp
 	$(COMPILER) -Us -Sg $(SYSTEMUNIT).pp
+systhrds$(PPUEXT): systhrds.pp $(INC)/threadh.inc $(SYSTEMUNIT)$(PPUEXT)
 objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMUNIT)$(PPUEXT)
 objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMUNIT)$(PPUEXT)
 	$(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/objpas.pp
 	$(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/objpas.pp
 strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc\
 strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc\

+ 3 - 1
rtl/win32/Makefile.fpc

@@ -7,7 +7,7 @@ main=rtl
 
 
 [target]
 [target]
 loaders=wprt0 wdllprt0
 loaders=wprt0 wdllprt0
-units=$(SYSTEMUNIT) threads objpas strings \
+units=$(SYSTEMUNIT) systhrds objpas strings \
       lineinfo heaptrc \
       lineinfo heaptrc \
       windows ole2 activex opengl32 winsock initc \
       windows ole2 activex opengl32 winsock initc \
       dos crt objects graph messages \
       dos crt objects graph messages \
@@ -104,6 +104,8 @@ wdllprt0$(OEXT) : wdllprt0.as
 $(SYSTEMUNIT)$(PPUEXT) : $(SYSTEMUNIT).pp win32.inc $(SYSDEPS)
 $(SYSTEMUNIT)$(PPUEXT) : $(SYSTEMUNIT).pp win32.inc $(SYSDEPS)
         $(COMPILER) -Us -Sg $(SYSTEMUNIT).pp
         $(COMPILER) -Us -Sg $(SYSTEMUNIT).pp
 
 
+systhrds$(PPUEXT): systhrds.pp $(INC)/threadh.inc $(SYSTEMUNIT)$(PPUEXT)
+
 objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMUNIT)$(PPUEXT)
 objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMUNIT)$(PPUEXT)
         $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/objpas.pp
         $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/objpas.pp
 
 

+ 15 - 43
rtl/win32/threads.pp → rtl/win32/systhrds.pp

@@ -14,7 +14,7 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 
  **********************************************************************}
  **********************************************************************}
-unit threads;
+unit systhrds;
 interface
 interface
 
 
 {$S-}
 {$S-}
@@ -39,6 +39,13 @@ interface
 
 
 implementation
 implementation
 
 
+{*****************************************************************************
+                             Generic overloaded
+*****************************************************************************}
+
+{ Include generic overloaded routines }
+{$i thread.inc}
+
 
 
 {*****************************************************************************
 {*****************************************************************************
                            Local WINApi imports
                            Local WINApi imports
@@ -113,20 +120,6 @@ function GlobalFree(hMem : Pointer):Pointer; external 'kernel32' name 'GlobalFre
 { Include OS independent Threadvar initialization }
 { Include OS independent Threadvar initialization }
 {$i threadvar.inc}
 {$i threadvar.inc}
 
 
-    procedure InitThreadVars;
-      begin
-        { We're still running in single thread mode, setup the TLS }
-        TLSKey:=TlsAlloc;
-        { initialize threadvars }
-        init_all_unit_threadvars;
-        { allocate mem for main thread threadvars }
-        SysAllocateThreadVars;
-        { copy main thread threadvars }
-        copy_all_unit_threadvars;
-        { install threadvar handler }
-        fpc_threadvar_relocate_proc:=@SysRelocateThreadvar;
-      end;
-
 {$endif HASTHREADVAR}
 {$endif HASTHREADVAR}
 
 
 
 
@@ -134,9 +127,6 @@ function GlobalFree(hMem : Pointer):Pointer; external 'kernel32' name 'GlobalFre
                             Thread starting
                             Thread starting
 *****************************************************************************}
 *****************************************************************************}
 
 
-    const
-      DefaultStackSize = 32768; { including 16384 margin for stackchecking }
-
     type
     type
       pthreadinfo = ^tthreadinfo;
       pthreadinfo = ^tthreadinfo;
       tthreadinfo = record
       tthreadinfo = record
@@ -145,22 +135,6 @@ function GlobalFree(hMem : Pointer):Pointer; external 'kernel32' name 'GlobalFre
         stklen : cardinal;
         stklen : cardinal;
       end;
       end;
 
 
-    procedure InitThread(stklen:cardinal);
-      begin
-        SysResetFPU;
-        { ExceptAddrStack and ExceptObjectStack are threadvars       }
-        { so every thread has its on exception handling capabilities }
-        SysInitExceptions;
-        { Open all stdio fds again }
-        SysInitStdio;
-        InOutRes:=0;
-        // ErrNo:=0;
-        { Stack checking }
-        StackLength:=stklen;
-        StackBottom:=Sptr - StackLength;
-      end;
-
-
     procedure DoneThread;
     procedure DoneThread;
       begin
       begin
         { Release Threadvars }
         { Release Threadvars }
@@ -208,7 +182,9 @@ function GlobalFree(hMem : Pointer):Pointer; external 'kernel32' name 'GlobalFre
         if not IsMultiThread then
         if not IsMultiThread then
          begin
          begin
 {$ifdef HASTHREADVAR}
 {$ifdef HASTHREADVAR}
-           InitThreadVars;
+           { We're still running in single thread mode, setup the TLS }
+           TLSKey:=TlsAlloc;
+           InitThreadVars(@SysRelocateThreadvar);
 {$endif HASTHREADVAR}
 {$endif HASTHREADVAR}
            IsMultiThread:=true;
            IsMultiThread:=true;
          end;
          end;
@@ -294,19 +270,15 @@ procedure LeaveCriticalSection(var cs : TRTLCriticalSection);
       end;
       end;
 
 
 
 
-{*****************************************************************************
-                             Generic overloaded
-*****************************************************************************}
-
-{ Include generic overloaded routines }
-{$i thread.inc}
-
 initialization
 initialization
   InitHeapMutexes;
   InitHeapMutexes;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.1  2002-10-14 19:39:18  peter
+  Revision 1.1  2002-10-16 06:27:30  michael
+  + Renamed thread unit to systhrds
+
+  Revision 1.1  2002/10/14 19:39:18  peter
     * threads unit added for thread support
     * threads unit added for thread support
 
 
 }
 }