Next: , Previous: , Up: Executive Assembler Introduction   [Index]


8.1.5 The Resource Management

The application will see that the created temporaries are promtly destroyed. Additionally, since the process library is being made available for the interpreted programs, any child processes that completed execution will be waited for.

See Process Library.

static int
flat_text(void *context)
{
    int status;
    struct context_type *context_data;
    struct x1f4_indexset_type *indexset_data;

    context_data = context;

    indexset_data = context_data->indexset_data;

Collect whatever temporaries:

    status = indexset_data->autodeck_set.deck
	(&indexset_data->autodeck_set.text);

    if (SIGCHLD_received) {
	int excess;

Wait for any child processes that completed:

	excess = wait_some(context_data);
	if (excess) {
	    if (status) {
	    } else {
		status = excess;
	    }
	}
    }

    return status;
}
static int
wait_some(struct context_type *context_data)
{
    int status;
    struct x1f4_lxslip_type *lxslip_data;
    void *lxport;

    SIGCHLD_received = 0;

Pick the process library from the executive objects set:

See struct x1f4_indexset_type.

See struct x1f4_lxslip_type.

See x1f4_note_lxport.

    lxslip_data = context_data->indexset_data->sliplong_set.lxslip_data;
    while (lxslip_data->note != x1f4_note_lxport) {
	lxslip_data++;
    }

    lxport = lxslip_data->slip;

    while (1) {
	pid_t wait;

	wait = waitpid(-1, NULL, WNOHANG);
	if (wait == -1) {
	    status = 0;
	    if (1) {
		break;
	    }
	} else {
	    if (wait) {

Some child processes may have completed, wait for them:

See x1f4_wait_lxport.

		x1f4_wait_lxport(lxport, wait);
	    } else {
		status = 0;
		if (1) {
		    break;
		}
	    }
	}
    }

    return status;
}