void update_main(void *);
void update_sched(void *);
void shutdown_sequence(void *);
+void update_force(void *);
#endif
int
force(void)
{
- int seconds;
- time_t now;
+ static int seconds;
if (update_pending) {
pr("Update is pending\n");
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;
}
/*NOTREACHED*/
}
+void
+update_force(void *seconds)
+{
+ time_t now;
+
+ time(&now);
+ empth_sleep(now + *(int *)seconds);
+ empth_sem_signal(update_sem);
+ empth_exit();
+}
+
/*ARGSUSED*/
static void
update_wait(void *unused)