[Lazarus] thread safe
Marco van de Voort
marcov at stack.nl
Mon Jun 13 00:06:15 CEST 2011
On Sat, Jun 11, 2011 at 02:41:03AM +0100, Hans-Peter Diettrich wrote:
> threads at the same time".
>
> Which piece of code can *not* be "safely invoked"?
>
> Instead I'd define "thread safety" as the *absence* of possible data or
> state inconsistencies in concurrent execution [of threads].
The FileExistsUTF8() definition even adheres to that. The possible
inconsistency is in a different layer, the OS layer outside the runtime and
language's reach.
In short, then you must simply open the file for exclusive access and abort
on failure to open, instead of checking for existance.
More information about the Lazarus
mailing list