|
Lines 3290-3297
Link Here
|
| 3290 |
} |
3290 |
} |
| 3291 |
} |
3291 |
} |
| 3292 |
}; |
3292 |
}; |
| 3293 |
thread.setDaemon(true); |
|
|
| 3294 |
thread.start(); |
| 3295 |
|
3293 |
|
| 3296 |
if (Trace.FINEST) { |
3294 |
if (Trace.FINEST) { |
| 3297 |
Trace.trace(Trace.STRING_FINEST, "synchronousRestart 2"); |
3295 |
Trace.trace(Trace.STRING_FINEST, "synchronousRestart 2"); |
|
Lines 3300-3305
Link Here
|
| 3300 |
// call the delegate restart |
3298 |
// call the delegate restart |
| 3301 |
try { |
3299 |
try { |
| 3302 |
getBehaviourDelegate(null).restart(launchMode); |
3300 |
getBehaviourDelegate(null).restart(launchMode); |
|
|
3301 |
|
| 3302 |
thread.setDaemon(true); |
| 3303 |
thread.start(); |
| 3303 |
} catch (CoreException e) { |
3304 |
} catch (CoreException e) { |
| 3304 |
removeServerListener(listener); |
3305 |
removeServerListener(listener); |
| 3305 |
timer.alreadyDone = true; |
3306 |
timer.alreadyDone = true; |
|
Lines 3435-3442
Link Here
|
| 3435 |
} |
3436 |
} |
| 3436 |
} |
3437 |
} |
| 3437 |
}; |
3438 |
}; |
| 3438 |
thread.setDaemon(true); |
|
|
| 3439 |
thread.start(); |
| 3440 |
|
3439 |
|
| 3441 |
if (Trace.FINEST) { |
3440 |
if (Trace.FINEST) { |
| 3442 |
Trace.trace(Trace.STRING_FINEST, "synchronousStart 2"); |
3441 |
Trace.trace(Trace.STRING_FINEST, "synchronousStart 2"); |
|
Lines 3445-3453
Link Here
|
| 3445 |
// start the server |
3444 |
// start the server |
| 3446 |
try { |
3445 |
try { |
| 3447 |
startImpl2(launchMode, monitor); |
3446 |
startImpl2(launchMode, monitor); |
|
|
3447 |
|
| 3448 |
thread.setDaemon(true); |
| 3449 |
thread.start(); |
| 3448 |
} catch (CoreException e) { |
3450 |
} catch (CoreException e) { |
| 3449 |
removeServerListener(listener); |
3451 |
removeServerListener(listener); |
| 3450 |
timer.alreadyDone = true; |
|
|
| 3451 |
return e.getStatus(); |
3452 |
return e.getStatus(); |
| 3452 |
} |
3453 |
} |
| 3453 |
if (monitor.isCanceled()) { |
3454 |
if (monitor.isCanceled()) { |
|
Lines 3561-3571
Link Here
|
| 3561 |
final Timer timer = new Timer(); |
3562 |
final Timer timer = new Timer(); |
| 3562 |
|
3563 |
|
| 3563 |
final int serverTimeout = getStopTimeout() * 1000; |
3564 |
final int serverTimeout = getStopTimeout() * 1000; |
|
|
3565 |
Thread thread = null; |
| 3564 |
if (serverTimeout > 0) { |
3566 |
if (serverTimeout > 0) { |
| 3565 |
Thread thread = new Thread("Server Stop Timeout") { |
3567 |
thread = new Thread("Server Stop Timeout") { |
| 3566 |
public void run() { |
3568 |
public void run() { |
| 3567 |
try { |
3569 |
try { |
| 3568 |
Thread.sleep(serverTimeout); |
3570 |
int totalTimeout = serverTimeout; |
|
|
3571 |
if (totalTimeout < 0) |
| 3572 |
totalTimeout = 1; |
| 3573 |
|
| 3574 |
int retryPeriod = 1000; |
| 3575 |
|
| 3576 |
while (totalTimeout > 0 && !timer.alreadyDone){ |
| 3577 |
Thread.sleep(retryPeriod); |
| 3578 |
if (serverTimeout > 0) |
| 3579 |
totalTimeout -= retryPeriod; |
| 3580 |
} |
| 3581 |
|
| 3569 |
if (!timer.alreadyDone) { |
3582 |
if (!timer.alreadyDone) { |
| 3570 |
timer.timeout = true; |
3583 |
timer.timeout = true; |
| 3571 |
// notify waiter |
3584 |
// notify waiter |
|
Lines 3584-3596
Link Here
|
| 3584 |
} |
3597 |
} |
| 3585 |
} |
3598 |
} |
| 3586 |
}; |
3599 |
}; |
| 3587 |
thread.setDaemon(true); |
|
|
| 3588 |
thread.start(); |
| 3589 |
} |
3600 |
} |
| 3590 |
|
3601 |
|
| 3591 |
// stop the server |
3602 |
// stop the server |
| 3592 |
stopImpl2(force); |
3603 |
stopImpl2(force); |
| 3593 |
|
3604 |
|
|
|
3605 |
if (thread != null){ |
| 3606 |
thread.setDaemon(true); |
| 3607 |
thread.start(); |
| 3608 |
} |
| 3609 |
|
| 3594 |
// wait for it! wait for it! |
3610 |
// wait for it! wait for it! |
| 3595 |
synchronized (mutex) { |
3611 |
synchronized (mutex) { |
| 3596 |
try { |
3612 |
try { |
|
Lines 3603-3608
Link Here
|
| 3603 |
"Error waiting for server stop", e); |
3619 |
"Error waiting for server stop", e); |
| 3604 |
} |
3620 |
} |
| 3605 |
} |
3621 |
} |
|
|
3622 |
timer.alreadyDone = true; |
| 3606 |
} |
3623 |
} |
| 3607 |
removeServerListener(listener); |
3624 |
removeServerListener(listener); |
| 3608 |
|
3625 |
|