Added experimental change to making DO calls ... run in NSConnectionReplyMode

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14100 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2002-07-09 07:35:28 +00:00
parent 79b3612729
commit 2a17d50744
3 changed files with 18 additions and 11 deletions

View file

@ -1,3 +1,9 @@
2002-07-09 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSTcpHandle.m: Always use runloop in NSConnectionReplyMode
to avoid other NSDefaultRunLoopMode events being triggered while
executing a DO method. **EXPERIMENTAL**
2002-07-08 Richard Frith-Macdonald <rfm@gnu.org> 2002-07-08 Richard Frith-Macdonald <rfm@gnu.org>
* Version: 1.4.0 * Version: 1.4.0

View file

@ -37,6 +37,7 @@
#include <Foundation/NSLock.h> #include <Foundation/NSLock.h>
#include <Foundation/NSHost.h> #include <Foundation/NSHost.h>
#include <Foundation/NSThread.h> #include <Foundation/NSThread.h>
#include <Foundation/NSConnection.h>
#include <Foundation/NSDebug.h> #include <Foundation/NSDebug.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -421,7 +422,7 @@ static Class runLoopClass;
return nil; return nil;
} }
#endif #endif
handle = (GSTcpHandle*)NSAllocateObject(self,0,NSDefaultMallocZone()); handle = (GSTcpHandle*)NSAllocateObject(self, 0, NSDefaultMallocZone());
handle->desc = d; handle->desc = d;
handle->wMsgs = [NSMutableArray new]; handle->wMsgs = [NSMutableArray new];
if (multi_threaded == YES) if (multi_threaded == YES)
@ -550,22 +551,22 @@ static Class runLoopClass;
[l addEvent: (void*)(gsaddr)desc [l addEvent: (void*)(gsaddr)desc
type: ET_WDESC type: ET_WDESC
watcher: self watcher: self
forMode: NSDefaultRunLoopMode]; forMode: NSConnectionReplyMode];
[l addEvent: (void*)(gsaddr)desc [l addEvent: (void*)(gsaddr)desc
type: ET_EDESC type: ET_EDESC
watcher: self watcher: self
forMode: NSDefaultRunLoopMode]; forMode: NSConnectionReplyMode];
while (state == GS_H_TRYCON && [when timeIntervalSinceNow] > 0) while (state == GS_H_TRYCON && [when timeIntervalSinceNow] > 0)
{ {
[l runMode: NSDefaultRunLoopMode beforeDate: when]; [l runMode: NSConnectionReplyMode beforeDate: when];
} }
[l removeEvent: (void*)(gsaddr)desc [l removeEvent: (void*)(gsaddr)desc
type: ET_WDESC type: ET_WDESC
forMode: NSDefaultRunLoopMode forMode: NSConnectionReplyMode
all: NO]; all: NO];
[l removeEvent: (void*)(gsaddr)desc [l removeEvent: (void*)(gsaddr)desc
type: ET_EDESC type: ET_EDESC
forMode: NSDefaultRunLoopMode forMode: NSConnectionReplyMode
all: NO]; all: NO];
if (state == GS_H_TRYCON) if (state == GS_H_TRYCON)
@ -1181,12 +1182,12 @@ static Class runLoopClass;
[l addEvent: (void*)(gsaddr)desc [l addEvent: (void*)(gsaddr)desc
type: ET_WDESC type: ET_WDESC
watcher: self watcher: self
forMode: NSDefaultRunLoopMode]; forMode: NSConnectionReplyMode];
while ([wMsgs indexOfObjectIdenticalTo: components] != NSNotFound while ([wMsgs indexOfObjectIdenticalTo: components] != NSNotFound
&& [when timeIntervalSinceNow] > 0) && [when timeIntervalSinceNow] > 0)
{ {
DO_UNLOCK(myLock); DO_UNLOCK(myLock);
[l runMode: NSDefaultRunLoopMode beforeDate: when]; [l runMode: NSConnectionReplyMode beforeDate: when];
DO_LOCK(myLock); DO_LOCK(myLock);
} }
/* /*
@ -1407,7 +1408,7 @@ static Class tcpPortClass;
if (port == nil) if (port == nil)
{ {
port = (GSTcpPort*)NSAllocateObject(self,0,NSDefaultMallocZone()); port = (GSTcpPort*)NSAllocateObject(self, 0, NSDefaultMallocZone());
port->listener = -1; port->listener = -1;
port->host = RETAIN(aHost); port->host = RETAIN(aHost);
port->address = [addr copy]; port->address = [addr copy];

View file

@ -1784,7 +1784,7 @@ static void retEncoder (DOContext *ctxt)
} }
/* /*
* NSDistantObject's -forward: : method calls this to send the message * NSDistantObject's -forward:: method calls this to send the message
* over the wire. * over the wire.
*/ */
- (retval_t) forwardForProxy: (NSDistantObject*)object - (retval_t) forwardForProxy: (NSDistantObject*)object
@ -1916,7 +1916,7 @@ static void retEncoder (DOContext *ctxt)
* NSDistantObject's -forwardInvocation: method calls this to send the message * NSDistantObject's -forwardInvocation: method calls this to send the message
* over the wire. * over the wire.
*/ */
- (void) forwardInvocation: (NSInvocation *)inv - (void) forwardInvocation: (NSInvocation*)inv
forProxy: (NSDistantObject*)object forProxy: (NSDistantObject*)object
{ {
NSPortCoder *op; NSPortCoder *op;