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:
Richard Frith-Macdonald 2002-07-09 07:35:28 +00:00
parent 4300adf1aa
commit 995a21c468
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>
* Version: 1.4.0

View file

@ -37,6 +37,7 @@
#include <Foundation/NSLock.h>
#include <Foundation/NSHost.h>
#include <Foundation/NSThread.h>
#include <Foundation/NSConnection.h>
#include <Foundation/NSDebug.h>
#include <stdio.h>
#include <stdlib.h>
@ -421,7 +422,7 @@ static Class runLoopClass;
return nil;
}
#endif
handle = (GSTcpHandle*)NSAllocateObject(self,0,NSDefaultMallocZone());
handle = (GSTcpHandle*)NSAllocateObject(self, 0, NSDefaultMallocZone());
handle->desc = d;
handle->wMsgs = [NSMutableArray new];
if (multi_threaded == YES)
@ -550,22 +551,22 @@ static Class runLoopClass;
[l addEvent: (void*)(gsaddr)desc
type: ET_WDESC
watcher: self
forMode: NSDefaultRunLoopMode];
forMode: NSConnectionReplyMode];
[l addEvent: (void*)(gsaddr)desc
type: ET_EDESC
watcher: self
forMode: NSDefaultRunLoopMode];
forMode: NSConnectionReplyMode];
while (state == GS_H_TRYCON && [when timeIntervalSinceNow] > 0)
{
[l runMode: NSDefaultRunLoopMode beforeDate: when];
[l runMode: NSConnectionReplyMode beforeDate: when];
}
[l removeEvent: (void*)(gsaddr)desc
type: ET_WDESC
forMode: NSDefaultRunLoopMode
forMode: NSConnectionReplyMode
all: NO];
[l removeEvent: (void*)(gsaddr)desc
type: ET_EDESC
forMode: NSDefaultRunLoopMode
forMode: NSConnectionReplyMode
all: NO];
if (state == GS_H_TRYCON)
@ -1181,12 +1182,12 @@ static Class runLoopClass;
[l addEvent: (void*)(gsaddr)desc
type: ET_WDESC
watcher: self
forMode: NSDefaultRunLoopMode];
forMode: NSConnectionReplyMode];
while ([wMsgs indexOfObjectIdenticalTo: components] != NSNotFound
&& [when timeIntervalSinceNow] > 0)
{
DO_UNLOCK(myLock);
[l runMode: NSDefaultRunLoopMode beforeDate: when];
[l runMode: NSConnectionReplyMode beforeDate: when];
DO_LOCK(myLock);
}
/*
@ -1407,7 +1408,7 @@ static Class tcpPortClass;
if (port == nil)
{
port = (GSTcpPort*)NSAllocateObject(self,0,NSDefaultMallocZone());
port = (GSTcpPort*)NSAllocateObject(self, 0, NSDefaultMallocZone());
port->listener = -1;
port->host = RETAIN(aHost);
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.
*/
- (retval_t) forwardForProxy: (NSDistantObject*)object
@ -1916,7 +1916,7 @@ static void retEncoder (DOContext *ctxt)
* NSDistantObject's -forwardInvocation: method calls this to send the message
* over the wire.
*/
- (void) forwardInvocation: (NSInvocation *)inv
- (void) forwardInvocation: (NSInvocation*)inv
forProxy: (NSDistantObject*)object
{
NSPortCoder *op;