mirror of
https://github.com/ipxe/ipxe
synced 2025-12-22 13:00:39 +03:00
[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:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user