mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +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
8755ceb15b
commit
56ba86ce4c
2 changed files with 7 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue