mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 08:41:03 +00:00
Handle lockDate being nil.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14612 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7efb3e5c9d
commit
804ad341cd
2 changed files with 14 additions and 2 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2002-10-01 02:21 Alexander Malmberg <alexander@malmberg.org>
|
||||||
|
|
||||||
|
* Source/NSUserDefaults.m (-synchronize): Handle lockDate being nil.
|
||||||
|
|
||||||
2002-09-30 Richard Frith-Macdonald <rfm@gnu.org>
|
2002-09-30 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* NSTimeZones/NSTimeZones.tar: Updated to latest information.
|
* NSTimeZones/NSTimeZones.tar: Updated to latest information.
|
||||||
|
|
|
@ -1184,10 +1184,18 @@ static NSString *pathForUser(NSString *user)
|
||||||
while ([_fileLock tryLock] == NO)
|
while ([_fileLock tryLock] == NO)
|
||||||
{
|
{
|
||||||
CREATE_AUTORELEASE_POOL(arp);
|
CREATE_AUTORELEASE_POOL(arp);
|
||||||
NSDate *when;
|
NSDate *when, *lockDate;
|
||||||
|
|
||||||
|
lockDate = [_fileLock lockDate];
|
||||||
|
/* If the lock has already been released, lockDate will be nil. If
|
||||||
|
so, just try again. */
|
||||||
|
if (!lockDate)
|
||||||
|
{
|
||||||
|
RELEASE(arp);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
when = [NSDate dateWithTimeIntervalSinceNow: 0.1];
|
when = [NSDate dateWithTimeIntervalSinceNow: 0.1];
|
||||||
if ([when timeIntervalSinceDate: [_fileLock lockDate]] > 5.0)
|
if ([when timeIntervalSinceDate: lockDate] > 5.0)
|
||||||
{
|
{
|
||||||
[_fileLock breakLock];
|
[_fileLock breakLock];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue