mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-27 18:50:47 +00:00
Thread safetly fix suggested by Wim
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23402 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b3f9244b29
commit
ab1489c970
2 changed files with 13 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2006-09-06 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSConnection.m: ([release]) protect with connection table
|
||||||
|
lock to prevent an other thread grabbing the connection while we
|
||||||
|
are deallocating it. Bug reported by Wim Oudshoorn.
|
||||||
|
|
||||||
2006-08-28 Adam Fedor <fedor@gnu.org>
|
2006-08-28 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
* Version 1.13.0
|
* Version 1.13.0
|
||||||
|
|
|
@ -1282,15 +1282,22 @@ static NSLock *cached_proxies_gate = nil;
|
||||||
/*
|
/*
|
||||||
* If this would cause the connection to be deallocated then we
|
* If this would cause the connection to be deallocated then we
|
||||||
* must perform all necessary work (done in [-gcFinalize]).
|
* must perform all necessary work (done in [-gcFinalize]).
|
||||||
|
*
|
||||||
* We bracket the code with a retain and release so that any
|
* We bracket the code with a retain and release so that any
|
||||||
* retain/release pairs in the code won't cause recursion.
|
* retain/release pairs in the code won't cause recursion.
|
||||||
|
*
|
||||||
|
* We lock the connection table while checking, to prevent
|
||||||
|
* another thread from grabbing this connection while we are
|
||||||
|
* finalizing/deallocating it.
|
||||||
*/
|
*/
|
||||||
|
M_LOCK(connection_table_gate);
|
||||||
if ([self retainCount] == 1)
|
if ([self retainCount] == 1)
|
||||||
{
|
{
|
||||||
[super retain];
|
[super retain];
|
||||||
[self gcFinalize];
|
[self gcFinalize];
|
||||||
[super release];
|
[super release];
|
||||||
}
|
}
|
||||||
|
M_UNLOCK(connection_table_gate);
|
||||||
[super release];
|
[super release];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue