mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
patch by Larry Campbell plus removal of some garbage collection vestiges
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@40008 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9188a050ef
commit
27899e4d66
6 changed files with 13 additions and 22 deletions
|
@ -1,3 +1,8 @@
|
|||
2016-07-18 Larry Campbell <lcampbel@akamai.com>
|
||||
|
||||
* Source/NSThread.m: Send notification about becoming multithreaded
|
||||
when the new thread is registered from outside our API.
|
||||
|
||||
2016-07-18 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSOperation.m: avoid sorting the queue ... keep the array of
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#define EXPOSE_NSAutoreleasePool_IVARS 1
|
||||
#define EXPOSE_NSThread_IVARS 1
|
||||
#import "Foundation/NSAutoreleasePool.h"
|
||||
#import "Foundation/NSGarbageCollector.h"
|
||||
#import "Foundation/NSException.h"
|
||||
#import "Foundation/NSThread.h"
|
||||
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
#import "Foundation/NSDictionary.h"
|
||||
#import "Foundation/NSEnumerator.h"
|
||||
#import "Foundation/NSException.h"
|
||||
#import "Foundation/NSGarbageCollector.h"
|
||||
#import "Foundation/NSHashTable.h"
|
||||
|
||||
#import "NSConcretePointerFunctions.h"
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
#import "Foundation/NSDictionary.h"
|
||||
#import "Foundation/NSEnumerator.h"
|
||||
#import "Foundation/NSException.h"
|
||||
#import "Foundation/NSGarbageCollector.h"
|
||||
#import "Foundation/NSMapTable.h"
|
||||
|
||||
#import "NSConcretePointerFunctions.h"
|
||||
|
|
|
@ -26,14 +26,11 @@
|
|||
#import "common.h"
|
||||
#import "Foundation/NSGarbageCollector.h"
|
||||
|
||||
static NSGarbageCollector *collector = nil;
|
||||
static unsigned disabled = 0;
|
||||
|
||||
@implementation NSGarbageCollector
|
||||
|
||||
+ (id) defaultCollector
|
||||
{
|
||||
return collector;
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void) collectIfNeeded
|
||||
|
@ -68,12 +65,8 @@ static unsigned disabled = 0;
|
|||
|
||||
- (id) init
|
||||
{
|
||||
if (self != collector)
|
||||
{
|
||||
[self dealloc];
|
||||
self = nil;
|
||||
}
|
||||
return self;
|
||||
[self dealloc];
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (BOOL) isCollecting
|
||||
|
@ -83,11 +76,7 @@ static unsigned disabled = 0;
|
|||
|
||||
- (BOOL) isEnabled
|
||||
{
|
||||
if (disabled)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (NSZone*) zone
|
||||
|
|
|
@ -73,7 +73,6 @@
|
|||
#import "Foundation/NSConnection.h"
|
||||
#import "Foundation/NSInvocation.h"
|
||||
#import "Foundation/NSUserDefaults.h"
|
||||
#import "Foundation/NSGarbageCollector.h"
|
||||
#import "Foundation/NSValue.h"
|
||||
|
||||
#import "GSPrivate.h"
|
||||
|
@ -734,7 +733,6 @@ gnustep_base_thread_callback(void)
|
|||
static void
|
||||
setThreadForCurrentThread(NSThread *t)
|
||||
{
|
||||
[[NSGarbageCollector defaultCollector] disableCollectorForPointer: t];
|
||||
pthread_setspecific(thread_object_key, t);
|
||||
gnustep_base_thread_callback();
|
||||
}
|
||||
|
@ -764,7 +762,6 @@ unregisterActiveThread(NSThread *thread)
|
|||
[(GSRunLoopThreadInfo*)thread->_runLoopInfo invalidate];
|
||||
RELEASE(thread);
|
||||
|
||||
[[NSGarbageCollector defaultCollector] enableCollectorForPointer: thread];
|
||||
pthread_setspecific(thread_object_key, nil);
|
||||
}
|
||||
}
|
||||
|
@ -784,9 +781,12 @@ unregisterActiveThread(NSThread *thread)
|
|||
{
|
||||
t = [self new];
|
||||
t->_active = YES;
|
||||
[[NSGarbageCollector defaultCollector] disableCollectorForPointer: t];
|
||||
pthread_setspecific(thread_object_key, t);
|
||||
GS_CONSUMED(t);
|
||||
if (defaultThread != nil && t != defaultThread)
|
||||
{
|
||||
gnustep_base_thread_callback();
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
return NO;
|
||||
|
|
Loading…
Reference in a new issue