mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
More message port work.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21986 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e848a285c4
commit
50969bf11d
4 changed files with 41 additions and 13 deletions
|
@ -206,18 +206,26 @@ static void clean_up_names(void)
|
|||
{
|
||||
NSString *n;
|
||||
|
||||
NSDebugLLog(@"NSMessagePort", @"portForName: %@ host: %@", name, host);
|
||||
NSDebugLLog(@"NSMessagePortNameServer",
|
||||
@"portForName: %@ host: %@", name, host);
|
||||
|
||||
if ([host length] && ![host isEqual: @"*"])
|
||||
{
|
||||
NSDebugLLog(@"NSMessagePort", @"non-local host");
|
||||
NSDebugLLog(@"NSMessagePortNameServer", @"non-local host");
|
||||
return nil;
|
||||
}
|
||||
|
||||
n = [[self class] _query: name];
|
||||
|
||||
NSDebugLLog(@"NSMessagePort", @"got %@", n);
|
||||
return AUTORELEASE([NSMessagePort newWithName: n]);
|
||||
if (n == nil)
|
||||
{
|
||||
NSDebugLLog(@"NSMessagePortNameServer", @"got no port for %@", name);
|
||||
return nil;
|
||||
}
|
||||
else
|
||||
{
|
||||
NSDebugLLog(@"NSMessagePortNameServer", @"got %@ for %@", n, name);
|
||||
return AUTORELEASE([NSMessagePort newWithName: n]);
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL) registerPort: (NSPort *)port
|
||||
|
@ -227,7 +235,7 @@ static void clean_up_names(void)
|
|||
NSString *n;
|
||||
int rc;
|
||||
|
||||
NSDebugLLog(@"NSMessagePort", @"register %@ as %@\n", port, name);
|
||||
NSDebugLLog(@"NSMessagePortNameServer", @"register %@ as %@\n", port, name);
|
||||
if ([port isKindOfClass: [NSMessagePort class]] == NO)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
|
@ -238,7 +246,7 @@ static void clean_up_names(void)
|
|||
|
||||
if ([[self class] _query: name] != nil)
|
||||
{
|
||||
NSDebugLLog(@"NSMessagePort", @"fail, is a live port");
|
||||
NSDebugLLog(@"NSMessagePortNameServer", @"fail, is a live port");
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
@ -286,7 +294,7 @@ static void clean_up_names(void)
|
|||
NSString *n;
|
||||
int rc;
|
||||
|
||||
NSDebugLLog(@"NSMessagePort", @"removePortForName: %@", name);
|
||||
NSDebugLLog(@"NSMessagePortNameServer", @"removePortForName: %@", name);
|
||||
n = [[self class] _translate: name];
|
||||
rc = RegDeleteValueW(key, UNISTR(n));
|
||||
|
||||
|
@ -309,7 +317,7 @@ static void clean_up_names(void)
|
|||
NSMutableArray *a;
|
||||
int i;
|
||||
|
||||
NSDebugLLog(@"NSMessagePort", @"removePort: %@", port);
|
||||
NSDebugLLog(@"NSMessagePortNameServer", @"removePort: %@", port);
|
||||
|
||||
[serverLock lock];
|
||||
a = NSMapGet(portToNamesMap, port);
|
||||
|
@ -327,7 +335,8 @@ static void clean_up_names(void)
|
|||
|
||||
- (BOOL) removePort: (NSPort*)port forName: (NSString*)name
|
||||
{
|
||||
NSDebugLLog(@"NSMessagePort", @"removePort: %@ forName: %@", port, name);
|
||||
NSDebugLLog(@"NSMessagePortNameServer",
|
||||
@"removePort: %@ forName: %@", port, name);
|
||||
|
||||
if ([self portForName: name onHost: @""] == port)
|
||||
{
|
||||
|
|
|
@ -772,8 +772,6 @@ static unsigned wordAlign;
|
|||
|
||||
M_LOCK(this->lock);
|
||||
|
||||
retry:
|
||||
|
||||
if (this->wData != nil)
|
||||
{
|
||||
/*
|
||||
|
@ -830,7 +828,7 @@ retry:
|
|||
{
|
||||
NSDebugMLLog(@"NSMessagePort", @"Write of %d performs %d",
|
||||
[this->wData length] - this->wLength, this->wSize);
|
||||
goto retry;
|
||||
SetEvent(this->wEvent);
|
||||
}
|
||||
else if ((errno = GetLastError()) != ERROR_IO_PENDING)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue