| Programming C# C++ (7) Delphi (618) .NET (2) Database (71) Delphi IDE (90) Network (39) Printing (3) Strings (12) VCL (83) Windows with Delphi (280) Java (8) JavaScript (30) perl (9) php (4) VBScript (1) Visual Basic (1)
|
Thread-safe and not threadsafe functions in Delphi
(1 votes). Leave comments and/ or rate it.
Question: Some Delphi functions, like format, strToDate, ... have two versions : one that is not thread-safe, and another one (with a TFormatSettings parameter) that is thread-safe.Is there a way to forbid the use of the not thread-safe functions? Answer: While there is no known list of all functions that are not thread-safe, you can start building such a list and disable them by defining global constants as shown below.With these definitions, you can still call System.Append() if you really want to and know what you're doing, but it prevents the casual use of the function.
Comments:
|