ucrstra

Description

Function ucrstra is called immediately before a resource changes to a new state.

Synopsis


#include "factor.h"

void ucrstra(pstRes, pstLoad, newstate)

RESRC *pstRes;  /* Pointer to the resource that changed. */
LOAD *pstLoad;  /* Pointer to the current load. */
int  newstate; /* New state. */

Returns

Nothing.

Note: This function can be used to trace the state of a resource during a Scheduler. The new state value is a constant defined in factor.h and can be changed by calling the function secsrs (see Section 6.11). See the table below for the states:
State Description
RS_PROC Processing.
RS_SETUP Undergoing setup.
RS_BLOCKED Allocated but not processing.
RS_IDLE Idle.
RS_BREAK Broken down.
RS_MAINT Undergoing maintenance.
RS_OFFSHIFT Off shift.

The old state can be obtained from the resource structure, pstRes->rsstate.

It is possible that pstLoad will be NULL when this function is called.