Contents

os_workgroup_interval_update

Schedules a new deadline for workgroup threads that run at regular intervals.

Declaration

extern int os_workgroup_interval_update(os_workgroup_interval_t wg, uint64_t deadline, os_workgroup_interval_data_t data);

Parameters

  • wg:

    A workgroup containing one or more threads, including the current thread. If the current thread is not part of this workgroup, this function aborts the process.

  • deadline:

    The ideal time at which you expect the threads to complete the task for the current interval. The system uses this parameter to assess whether your threads finish early, on-time, or later than expected. Specify this value using the time units of the workgroup. For a list of possible time units, see Os_clockid_t. This value must be greater than the value in the start parameter.

  • data:

    Additional interval data. Specify NULL for this parameter.

Return Value

A value of 0 on success, or a nonzero error code indicating why the function failed. Common error codes include EINVAL or EPERM. For example, this method returns EINVAL if you didn’t start the workgroup.

Discussion

Call this function between calls to the os_workgroup_interval_start and os_workgroup_interval_finish functions. Typically, you call it at regular intervals to set a new deadline for any ongoing work. For example, after delivering content for the current video frame, call this function to set the deadline for finishing the next video frame. Call this function only once for each new interval. If your workgroup contains multiple threads, designate one thread to start, stop, and update the group.

This function returns an error if you created the workgroup using the os_workgroup_create_with_workgroup or os_workgroup_create_with_port function. This function works only on workgroups that you create using the os_workgroup_interval_create function.

See Also

Interval Tasks