mirror of
https://github.com/gnustep/libs-ec.git
synced 2025-02-23 03:41:23 +00:00
Try to ensure better graceful shutdown.
This commit is contained in:
parent
f9cb29322b
commit
7c28291e50
1 changed files with 13 additions and 4 deletions
17
EcCommand.m
17
EcCommand.m
|
@ -454,6 +454,7 @@ static NSMutableDictionary *launchInfo = nil;
|
||||||
- (void) newConfig: (NSMutableDictionary*)newConfig;
|
- (void) newConfig: (NSMutableDictionary*)newConfig;
|
||||||
- (void) pingControl;
|
- (void) pingControl;
|
||||||
- (void) quitAll;
|
- (void) quitAll;
|
||||||
|
- (void) quitAll: (NSDate*)by;
|
||||||
- (void) reLaunch: (NSTimer*)t;
|
- (void) reLaunch: (NSTimer*)t;
|
||||||
- (void) requestConfigFor: (id<CmdConfig>)c;
|
- (void) requestConfigFor: (id<CmdConfig>)c;
|
||||||
- (NSData*) registerClient: (id<CmdClient>)c
|
- (NSData*) registerClient: (id<CmdClient>)c
|
||||||
|
@ -2683,6 +2684,15 @@ static NSMutableDictionary *launchInfo = nil;
|
||||||
|
|
||||||
- (void) quitAll
|
- (void) quitAll
|
||||||
{
|
{
|
||||||
|
[self quitAll: nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) quitAll: (NSDate*)by
|
||||||
|
{
|
||||||
|
if (nil == by)
|
||||||
|
{
|
||||||
|
by = [NSDate dateWithTimeIntervalSinceNow: 35.0];
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* Suspend any task that might potentially be started.
|
* Suspend any task that might potentially be started.
|
||||||
*/
|
*/
|
||||||
|
@ -2702,7 +2712,6 @@ static NSMutableDictionary *launchInfo = nil;
|
||||||
{
|
{
|
||||||
NSUInteger i;
|
NSUInteger i;
|
||||||
NSMutableArray *a;
|
NSMutableArray *a;
|
||||||
NSDate *when = [NSDate dateWithTimeIntervalSinceNow: 35.0];
|
|
||||||
|
|
||||||
/* Now we tell all connected clients to quit.
|
/* Now we tell all connected clients to quit.
|
||||||
*/
|
*/
|
||||||
|
@ -2739,7 +2748,7 @@ static NSMutableDictionary *launchInfo = nil;
|
||||||
|
|
||||||
/* Give the clients a short time to quit.
|
/* Give the clients a short time to quit.
|
||||||
*/
|
*/
|
||||||
while ([a count] > 0 && [when timeIntervalSinceNow] > 0.0)
|
while ([a count] > 0 && [by timeIntervalSinceNow] > 0.0)
|
||||||
{
|
{
|
||||||
NSDate *next = [NSDate dateWithTimeIntervalSinceNow: 2.0];
|
NSDate *next = [NSDate dateWithTimeIntervalSinceNow: 2.0];
|
||||||
|
|
||||||
|
@ -3329,8 +3338,8 @@ static NSMutableDictionary *launchInfo = nil;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
[self quitAll];
|
[self quitAll: terminateBy];
|
||||||
terminating = [NSTimer scheduledTimerWithTimeInterval: ti
|
terminating = [NSTimer scheduledTimerWithTimeInterval: ti + 1.0
|
||||||
target: self
|
target: self
|
||||||
selector: _cmd
|
selector: _cmd
|
||||||
userInfo: nil
|
userInfo: nil
|
||||||
|
|
Loading…
Reference in a new issue