[Gambas-devel] Question about singleton class
Benoît Minisini
gambas at ...1...
Wed Sep 10 21:34:45 CEST 2014
Le 10/09/2014 21:04, John Leake a écrit :
>>
>> At the moment, you just have the LOCK instruction for that.
>>
> I see the docs say that the content is not of interest.
>
> Can you see any reason why I shouldn’t write my own PID and a sha1 of my
> process into the file if my process is granted access ?
>
> This way another process could delete the file if the content pid either
> does not exist or if the pid has been recycled and the sha1 does not match.
>
I quote you:
« I am looking for a system wide singleton with guaranteed mutual
exclusion to any executable written in Gambas. »
This is exactly what a file lock can do. I'm already doing that in the
big application I'm making for my job.
--
Benoît Minisini
More information about the Devel
mailing list