(force): Change to create update thread instead of calling

empth_sleep() as the empth_sleep() can not be aborted for an update.
(update_force): New.
This commit is contained in:
Ron Koenderink 2005-08-20 19:16:56 +00:00
parent 22456c4965
commit ef0dbf6790
3 changed files with 17 additions and 9 deletions

View file

@ -41,8 +41,7 @@
int
force(void)
{
int seconds;
time_t now;
static int seconds;
if (update_pending) {
pr("Update is pending\n");
@ -59,12 +58,9 @@ force(void)
seconds = onearg(player->argp[1], "Time until update [in seconds]? ");
if (seconds < 0)
return RET_FAIL;
if (seconds) {
time(&now);
pr("Waiting %d seconds...\n", seconds);
empth_sleep(now + seconds);
}
pr("Scheduling update now\n");
empth_sem_signal(update_sem);
pr("Scheduling update in %d second(s)\n", seconds);
empth_create(PP_SCHED, update_force, (50 * 1024), 0, "forceUpdate",
"Schedules an update", &seconds);
return RET_OK;
}