Hi,
I like time zone differences, I go to bed with a problem and wake up to a nice patch (or two) to read over breakfast :-) so here's one for you.
The only real solution to potential corruption is to make the writes to shared config files atomic. The patch uses the good old fashioned exclusive lock file method. IIUC this should also work on windows, but may need registry settings to be correct, I'm not sure. Nothing else I researched seemed to be portable.
In race conditions this patch doesn't say which write will win, but it is intended to guarantee that whichever does will be written atomically and not corrupted.
In general there is no way Geany can know which write should win, the user has to do that themselves by closing instances manually in the right order so the last wins.
The patch has both yours and mine in the one.
Your patches stop new_instances upsetting geany.conf and mine handles shared project files and geany.conf in the case of multiple main instances.
Lets see if anyone else can get it to fail.
Cheers Lex
On 21 May 2010 23:52, Dimitar Zhekov hamster@mbox.contact.bg wrote:
There is one more case when geany.conf may be modified by a secondary instance: saving the project-less file list on Project -> New / Open. Patch attached.
-- E-gards: Jimmy
Geany-devel mailing list Geany-devel@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel