Re-instated new poll() based runloop code.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@12275 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2002-01-30 15:28:50 +00:00
parent 5448f399a1
commit 2700f7ed6e
4 changed files with 1159 additions and 652 deletions

View file

@ -1,3 +1,12 @@
2002-01-30 Richard Frith-Macdonald <rfm@gnu.org>
* Headers/Foundation/NSRunLoop.h: Go back to new version.
* Source/NSRunLoop.m: Back to new (hopefully bug-free) version ...
fixed a fence-post error in examining descriptors. Enabled poll()
support if the O/S supports it. Converted to use standard debug
logging keyed on NSRunLoop. Fixed poll code to call any available
event handler when an error occurs on a descriptor.
2002-01-30 Richard Frith-Macdonald <rfm@gnu.org>
* Headers/gnustep/base/GSIMap.h: Fix bug cleaning table and add
option to specify type of enumerator structure externally.
@ -39,7 +48,7 @@
2002-01-30 Richard Frith-Macdonald <rfm@gnu.org>
* Headers/Foundation/NSRunLoop.h: revert
* Headers/Foundation/NSRunLoop.m: revert
* Source/NSRunLoop.m: revert
Revert to earlier version temporarily, while I try to track down
an obscure bug causing problems with some DO applications.

View file

@ -34,15 +34,11 @@ GS_EXPORT NSString* const NSDefaultRunLoopMode;
@interface NSRunLoop : NSObject <GCFinalization>
{
@private
id _current_mode;
NSMapTable *_mode_2_timers;
NSMapTable *_mode_2_watchers;
NSMapTable *_mode_2_performers;
NSMutableArray *_timedPerformers;
NSMapTable *_efdMap;
NSMapTable *_rfdMap;
NSMapTable *_wfdMap;
int _fdStart;
NSString *_currentMode;
NSMapTable *_contextMap;
NSMutableArray *_contextStack;
NSMutableArray *_timedPerformers;
void *_extra;
}
+ (NSRunLoop*) currentRunLoop;
@ -55,7 +51,7 @@ GS_EXPORT NSString* const NSDefaultRunLoopMode;
- (NSString*) currentMode;
- (NSDate*)limitDateForMode: (NSString*)mode;
- (NSDate*) limitDateForMode: (NSString*)mode;
- (void) run;
@ -72,14 +68,14 @@ GS_EXPORT NSString* const NSDefaultRunLoopMode;
forMode: (NSString*)mode;
- (void) cancelPerformSelector: (SEL)aSelector
target: target
argument: argument;
target: (id)target
argument: (id)argument;
- (void) configureAsServer;
- (void) performSelector: (SEL)aSelector
target: target
argument: argument
target: (id)target
argument: (id)argument
order: (unsigned int)order
modes: (NSArray*)modes;
@ -93,10 +89,10 @@ GS_EXPORT NSString* const NSDefaultRunLoopMode;
*/
typedef enum {
ET_RDESC, /* Watch for descriptor becoming readable. */
ET_WDESC, /* Watch for descriptor becoming writeable. */
ET_RPORT, /* Watch for message arriving on port. */
ET_EDESC /* Watch for descriptor with exception data. */
ET_RDESC, /* Watch for descriptor becoming readable. */
ET_WDESC, /* Watch for descriptor becoming writeable. */
ET_RPORT, /* Watch for message arriving on port. */
ET_EDESC /* Watch for descriptor with out-of-band data. */
} RunLoopEventType;
@protocol RunLoopEvents
@ -125,29 +121,9 @@ typedef enum {
@interface NSRunLoop(GNUstepExtensions)
#if 0
/*
* The following ten methods are DEPRECATED
* They will be removed in later releases of GNUstep
*/
+ currentInstance;
+ (NSString*) currentMode;
+ (void) run;
+ (BOOL) runOnceBeforeDate: (NSDate*)date;
+ (BOOL) runOnceBeforeDate: (NSDate*)date
forMode: (NSString*)mode;
+ (void) runUntilDate: (NSDate*)date;
+ (void) runUntilDate: (NSDate*)date
forMode: (NSString*)mode;
- (BOOL) runOnceBeforeDate: (NSDate*)date;
- (BOOL) runOnceBeforeDate: (NSDate*)date
forMode: (NSString*)mode;
- (void) runUntilDate: (NSDate*)date
forMode: (NSString*)mode;
#endif
/*
* These next two are general purpose methods for letting objects
* ask the runloop to watch for events for them. Only one object
* These are general purpose methods for letting objects ask
* the runloop to watch for events for them. Only one object
* at a time may be watching for a particular event in a mode, but
* that object may add itsself as a watcher many times as long as
* each addition is matched by a removal (the run loop keeps count).

View file

@ -256,17 +256,24 @@ static IMP initImp;
{
NSAutoreleasePool *pool = ARP_THREAD_VARS->current_pool;
if (pool)
(*pool->_addImp)(pool, @selector(addObject:), anObj);
if (pool != nil)
{
(*pool->_addImp)(pool, @selector(addObject:), anObj);
}
else
{
NSAutoreleasePool *arp = [NSAutoreleasePool new];
if (anObj)
NSLog(@"autorelease called without pool for object (%x) of class %@\n",
anObj, NSStringFromClass([anObj class]));
if (anObj != nil)
{
NSLog(@"autorelease called without pool for object (%x) "
@"of class %@ in thread %@", anObj,
NSStringFromClass([anObj class]), [NSThread currentThread]);
}
else
NSLog(@"autorelease called without pool for nil object.\n");
{
NSLog(@"autorelease called without pool for nil object.");
}
[arp release];
}
}

File diff suppressed because it is too large Load diff