discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Defaults being destroyed (Solved?)


From: Stefan Urbanek
Subject: Re: Defaults being destroyed (Solved?)
Date: Tue, 27 Aug 2002 08:18:27 +0100

On 2002-08-27 11:05:56 +0400 Alexey I. Froloff <raorn@binec.ru> wrote:

On Tue, Aug 27, 2002 at 07:15:07AM +0100, Stefan Urbanek wrote:
[/dev/null]
It seems, that if a program does not see some domain in
database at program startup, it will not write it back. It
may be a problem in -[NSUserDefaults synchronize] I think,
but I am not sure.
-[NSUserDefaults synchronize] uses NSLock than works between
threads but not processes. Writinig defaults database is not
atomic operation.

I think solution can be in using NSDistributedLock, but
timeout is needed in case some program dies when writing this
file...


This might be also an addition to the solution.

I have attached a patch for NSUserDefaults that seems to fix the problem. 
Attached is also the testing script. But it needs more testing.

Stefan


<NSUserDefaults.m.patch><test>

Attachment: NSUserDefaults.m.patch
Description: Binary data

Attachment: test
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]