|
@@ -82,9 +82,11 @@ void step ( void ) {
|
82
|
82
|
list_for_each_entry ( process, &run_queue, list ) {
|
83
|
83
|
list_del ( &process->list );
|
84
|
84
|
list_add_tail ( &process->list, &run_queue );
|
|
85
|
+ ref_get ( process->refcnt ); /* Inhibit destruction mid-step */
|
85
|
86
|
DBGC2 ( process, "PROCESS %p executing\n", process );
|
86
|
87
|
process->step ( process );
|
87
|
88
|
DBGC2 ( process, "PROCESS %p finished executing\n", process );
|
|
89
|
+ ref_put ( process->refcnt ); /* Allow destruction */
|
88
|
90
|
break;
|
89
|
91
|
}
|
90
|
92
|
}
|