mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 08:26:27 +00:00
Prevent potential deadlock in multithreaded programs due to an
allocation lock that was never unlocked. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28859 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9d215e7e76
commit
acb28bb1c2
2 changed files with 7 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
2009-10-20 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Source/NSObject.m (NSIncrementExtraRefCount): Properly release
|
||||
allocation lock.
|
||||
|
||||
2009-10-12 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSProcessInfo.m:
|
||||
|
|
|
@ -496,12 +496,12 @@ NSIncrementExtraRefCount(id anObject)
|
|||
[theLock lock];
|
||||
if (((obj)anObject)[-1].retained == UINT_MAX - 1)
|
||||
{
|
||||
objc_mutex_unlock (theLock);
|
||||
[theLock unlock];
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
format: @"NSIncrementExtraRefCount() asked to increment too far"];
|
||||
}
|
||||
((obj)anObject)[-1].retained++;
|
||||
[theLock lock];
|
||||
[theLock unlock];
|
||||
#endif /* GSATOMICREAD */
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue