Don't suspend thread when we don't have to.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4079 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 1999-04-14 14:13:20 +00:00
parent 0f420b6474
commit c6ee0fb059
3 changed files with 22 additions and 9 deletions

View file

@ -1,3 +1,10 @@
Wed Apr 14 14:32:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* Source/NSPortNameServer.m: Don't suspend thread while waiting for
gdomap to start up.
* Source/NSDistributedNotificationCenter.m: Don't suspend thread while
waiting for gdnc to start up.
Wed Apr 14 10:50:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* Source/NSBundle: ([+allBundles]) implemented (ignoring the frameworks

View file

@ -29,7 +29,7 @@
#include <Foundation/NSArchiver.h>
#include <Foundation/NSNotification.h>
#include <Foundation/NSDate.h>
#include <Foundation/NSThread.h>
#include <Foundation/NSRunLoop.h>
#include <Foundation/NSTask.h>
#include <Foundation/NSDistributedNotificationCenter.h>
@ -40,8 +40,8 @@
* message about it - they include installation path information.
*/
#define stringify_it(X) #X
#define make_gdnc_cmd(X) stringify_it(X) "/Tools/" GNUSTEP_TARGET_DIR "/gdnc"
#define make_gdnc_err(X) "check that " stringify_it(X) "/Tools/" GNUSTEP_TARGET_DIR "/gdnc is running."
#define make_gdnc_cmd(X) stringify_it(X) "/Tools/gdnc"
#define make_gdnc_err(X) "check that " stringify_it(X) "/Tools/gdnc is running."
/*
* Global variables for distributed notification center types.
@ -347,8 +347,11 @@ static NSDistributedNotificationCenter *defCenter = nil;
NSLog(@"NSDistributedNotificationCenter failed to contact GDNC server.\n");
NSLog(@"Attempting to start GDNC process - this will take several seconds.\n");
[NSTask launchedTaskWithLaunchPath: cmd arguments: nil];
[NSThread sleepUntilDate:
[NSDate dateWithTimeIntervalSinceNow: 8.0]];
[NSTimer scheduledTimerWithTimeInterval: 5.0
invocation: nil
repeats: NO];
[[NSRunLoop currentRunLoop] runUntilDate:
[NSDate dateWithTimeIntervalSinceNow: 5.0]];
NSLog(@"Retrying connection to the GDNC server.\n");
recursion = YES;
[self _connect];

View file

@ -36,7 +36,6 @@
#include <Foundation/NSHost.h>
#include <Foundation/NSTask.h>
#include <Foundation/NSDate.h>
#include <Foundation/NSThread.h>
#include <Foundation/NSPortNameServer.h>
#include <base/TcpPort.h>
@ -50,8 +49,8 @@
* message about it - they include installation path information.
*/
#define stringify_it(X) #X
#define make_gdomap_cmd(X) stringify_it(X) "/Tools/"GNUSTEP_TARGET_DIR"/gdomap"
#define make_gdomap_err(X) "check that " stringify_it(X) "/Tools/"GNUSTEP_TARGET_DIR"/gdomap is running and owned by root."
#define make_gdomap_cmd(X) stringify_it(X) "/Tools/gdomap"
#define make_gdomap_err(X) "check that " stringify_it(X) "/Tools/gdomap is running and owned by root."
#define make_gdomap_port(X) stringify_it(X)
/*
@ -929,7 +928,11 @@ static NSPortNameServer *defaultServer = nil;
cmd = [NSString stringWithCString: make_gdomap_cmd(GNUSTEP_INSTALL_PREFIX)];
NSLog(@"NSPortNameServer attempting to start gdomap on local host");
[NSTask launchedTaskWithLaunchPath: cmd arguments: nil];
[NSThread sleepUntilDate: [NSDate dateWithTimeIntervalSinceNow: 5.0]];
[NSTimer scheduledTimerWithTimeInterval: 5.0
invocation: nil
repeats: NO];
[[NSRunLoop currentRunLoop] runUntilDate:
[NSDate dateWithTimeIntervalSinceNow: 5.0]];
NSLog(@"NSPortNameServer retrying connection attempt to gdomap");
[self _open: nil];
}