mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +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
|
@ -1184,10 +1184,18 @@ static NSString *pathForUser(NSString *user)
|
|||
while ([_fileLock tryLock] == NO)
|
||||
{
|
||||
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];
|
||||
if ([when timeIntervalSinceDate: [_fileLock lockDate]] > 5.0)
|
||||
if ([when timeIntervalSinceDate: lockDate] > 5.0)
|
||||
{
|
||||
[_fileLock breakLock];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue