[process] Add support for one-shot processes

Some processes execute only once, and exist solely in order to defer
execution until after the relevant instantiator method has returned.
Such processes do not need to be automatically rescheduled when
executing.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2011-06-24 14:18:48 +01:00
parent e01ec74601
commit ccc2655540
2 changed files with 24 additions and 2 deletions

View File

@@ -100,8 +100,12 @@ void step ( void ) {
ref_get ( process->refcnt ); /* Inhibit destruction mid-step */
desc = process->desc;
object = process_object ( process );
list_del ( &process->list );
list_add_tail ( &process->list, &run_queue );
if ( desc->reschedule ) {
list_del ( &process->list );
list_add_tail ( &process->list, &run_queue );
} else {
process_del ( process );
}
DBGC2 ( PROC_COL ( process ), "PROCESS " PROC_FMT
" executing\n", PROC_DBG ( process ) );
desc->step ( object );