lazutils: notes about thread safety

git-svn-id: trunk@41945 -
This commit is contained in:
mattias 2013-06-29 17:12:53 +00:00
parent 8ceb06c3e6
commit 04ad21f805
5 changed files with 18 additions and 8 deletions

View File

@ -22,6 +22,7 @@
Abstract: Abstract:
- simple file functions and fpc additions - simple file functions and fpc additions
- all functions are thread safe unless explicitely stated
} }
unit FileProcs; unit FileProcs;
@ -43,7 +44,7 @@ uses
MemCheck, MemCheck,
{$ENDIF} {$ENDIF}
Classes, SysUtils, LazUTF8, LazDbgLog, LazFileCache, LazFileUtils, Classes, SysUtils, LazUTF8, LazDbgLog, LazFileCache, LazFileUtils,
lazutf8classes, LazLogger, AVL_Tree, CodeToolsStrConsts; LazUTF8Classes, LazLogger, AVL_Tree, CodeToolsStrConsts;
type type
TFPCStreamSeekType = int64; TFPCStreamSeekType = int64;
@ -326,7 +327,7 @@ type
function CompareCTMemStat(Stat1, Stat2: TCTMemStat): integer; function CompareCTMemStat(Stat1, Stat2: TCTMemStat): integer;
function CompareNameWithCTMemStat(KeyAnsiString: Pointer; Stat: TCTMemStat): integer; function CompareNameWithCTMemStat(KeyAnsiString: Pointer; Stat: TCTMemStat): integer;
function GetTicks: int64; function GetTicks: int64; // not thread-safe
type type
TCTStackTracePointers = array of Pointer; TCTStackTracePointers = array of Pointer;
@ -341,7 +342,7 @@ function CTGetStackTrace(UseCache: boolean): string;
procedure CTGetStackTracePointers(var AStack: TCTStackTracePointers); procedure CTGetStackTracePointers(var AStack: TCTStackTracePointers);
function CTStackTraceAsString(const AStack: TCTStackTracePointers; function CTStackTraceAsString(const AStack: TCTStackTracePointers;
UseCache: boolean): string; UseCache: boolean): string;
function CTGetLineInfo(Addr: Pointer; UseCache: boolean): string; function CTGetLineInfo(Addr: Pointer; UseCache: boolean): string; // not thread safe
function CompareCTLineInfoCacheItems(Data1, Data2: Pointer): integer; function CompareCTLineInfoCacheItems(Data1, Data2: Pointer): integer;
function CompareAddrWithCTLineInfoCacheItem(Addr, Item: Pointer): integer; function CompareAddrWithCTLineInfoCacheItem(Addr, Item: Pointer): integer;

View File

@ -1,3 +1,6 @@
{
All functions are thread safe unless explicitely stated
}
unit LazFileUtils; unit LazFileUtils;
{$mode objfpc}{$H+} {$mode objfpc}{$H+}
@ -5,8 +8,7 @@ unit LazFileUtils;
interface interface
uses uses
Classes, SysUtils, LazUTF8, Classes, SysUtils, SysConst, LazUTF8, LazUtilsStrConsts;
SysConst, LazUtilsStrConsts;
{$IFDEF Windows} {$IFDEF Windows}
{$define CaseInsensitiveFilenames} {$define CaseInsensitiveFilenames}

View File

@ -11,6 +11,8 @@
***************************************************************************** *****************************************************************************
Useful routines for managing UTF-8 strings Useful routines for managing UTF-8 strings
- all functions are thread safe unless explicitely stated
} }
unit LazUTF8; unit LazUTF8;

View File

@ -1,13 +1,16 @@
unit lazutf8classes; unit LazUTF8Classes;
{$mode objfpc}{$H+} {$mode objfpc}{$H+}
interface interface
uses uses
Classes, SysUtils, lazutf8; Classes, SysUtils, LazUTF8;
type type
{ TFileStreamUTF8 }
TFileStreamUTF8 = class(THandleStream) TFileStreamUTF8 = class(THandleStream)
private private
FFileName: utf8string; FFileName: utf8string;
@ -18,6 +21,8 @@ type
property FileName: utf8string Read FFilename; property FileName: utf8string Read FFilename;
end; end;
{ TStringListUTF8 }
TStringListUTF8 = class(TStringList) TStringListUTF8 = class(TStringList)
protected protected
function DoCompareText(const s1,s2 : string) : PtrInt; override; function DoCompareText(const s1,s2 : string) : PtrInt; override;

View File

@ -9,7 +9,7 @@ interface
uses uses
laz2_DOM, Laz2_XMLCfg, laz2_XMLRead, laz2_xmlutils, laz2_XMLWrite, Laz_DOM, laz2_DOM, Laz2_XMLCfg, laz2_XMLRead, laz2_xmlutils, laz2_XMLWrite, Laz_DOM,
Laz_XMLCfg, Laz_XMLRead, Laz_XMLStreaming, Laz_XMLWrite, LazFileUtils, Laz_XMLCfg, Laz_XMLRead, Laz_XMLStreaming, Laz_XMLWrite, LazFileUtils,
LazFileCache, LazUTF8, LazDbgLog, paswstring, FileUtil, lazutf8classes, LazFileCache, LazUTF8, LazDbgLog, paswstring, FileUtil, LazUTF8Classes,
Masks, LazUtilsStrConsts, LConvEncoding, lazutf16, lazutf8sysutils, Masks, LazUtilsStrConsts, LConvEncoding, lazutf16, lazutf8sysutils,
LazMethodList, AvgLvlTree, LazLogger, LazFreeType, TTCache, TTCalc, TTCMap, LazMethodList, AvgLvlTree, LazLogger, LazFreeType, TTCache, TTCalc, TTCMap,
TTDebug, TTError, TTFile, TTGLoad, TTInterp, TTLoad, TTMemory, TTObjs, TTDebug, TTError, TTFile, TTGLoad, TTInterp, TTLoad, TTMemory, TTObjs,