mco_trans_rt_set_params

Modify parameters of a running real-time transaction.

Prototype

    typedef struct mco_trans_rt_params_t_ {
        mco_interval_t deadline;
    } mco_trans_rt_params_t;

    MCO_RET mco_trans_rt_set_params(
        /*IN*/ mco_trans_h t,
        /*IN*/ mco_trans_rt_params_t *params
    );

Arguments

t
Transaction handle.
params
Pointer to a mco_trans_rt_params_t structure containing the new deadline value. Only the deadline field is currently used.

Description

This function allows dynamic adjustment of a real-time transaction’s deadline while it is active. It is primarily used in two scenarios:

1. Adaptable Deadline Policy Recovery
When using the adaptable deadline policy (with mco_trans_rt_rollback_deadline_check()), the kernel may interrupt a transaction if insufficient time remains for a safe rollback. If the application fails to initiate rollback immediately — or if OS scheduling delays occur — the rollback itself may be interrupted by the original deadline, returning MCO_E_INTERRUPTED. In this case, the application can extend the deadline using mco_trans_rt_set_params() and retry the rollback.

2. Strict Deadline Policy Rollback Scheduling
Under the strict deadline policy, the transaction is interrupted exactly at the deadline, but the subsequent rollback runs to completion by default. To ensure the rollback also meets timing constraints, the application must explicitly limit its duration by updating the deadline via mco_trans_rt_set_params() before calling mco_trans_rollback().

Note: The only modifiable parameter at this time is the deadline. Future versions may support additional real-time parameters.

Return Codes

MCO_S_OK
Transaction parameters updated successfully.
MCO_E_INTERRUPTED
Transaction was interrupted by timer, callback, or another transaction before the update could be applied.

Files

Header file:
mco.h
Source file:
mcotrans.c
Library:
libmcolib.a