more threading fixes

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23448 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2006-09-10 13:30:05 +00:00
parent bdf6b69bce
commit 3f65c97d1a
3 changed files with 39 additions and 3 deletions

View file

@ -1428,6 +1428,19 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory)
return YES;
}
- (void) release
{
/* We lock during release so that other threads can't grab the
* object between us checking the reference count and deallocating.
*/
[load_lock lock];
if (NSDecrementExtraRefCountWasZero(self))
{
[self dealloc];
}
[load_lock unlock];
}
/* This method is the backbone of the resource searching for NSBundle. It
constructs an array of paths, where each path is a possible location
for a resource in the bundle. The current algorithm for searching goes: