<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "os",
  "identifier" : "/documentation/os/os_workgroup_interval_finish",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "os"
    ],
    "preciseIdentifier" : "c:@F@os_workgroup_interval_finish"
  },
  "title" : "os_workgroup_interval_finish"
}
-->

# os_workgroup_interval_finish

Stops the current interval-based execution of the workgroup’s threads.

```
extern int os_workgroup_interval_finish(os_workgroup_interval_t wg, 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.

`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 when you no longer need your workgroup’s threads to run at regular intervals. For example, call this function when the user’s video finishes playing and you no longer need to decode the video frames. This function puts the workgroup back into the idle state, from which you can start it again by calling the [`os_workgroup_interval_start`](/documentation/os/os_workgroup_interval_start) function.

This function returns an error if you created the workgroup using the [`os_workgroup_create_with_workgroup`](/documentation/os/os_workgroup_create_with_workgroup) or [`os_workgroup_create_with_port`](/documentation/os/os_workgroup_create_with_port) function. This function works only on workgroups that you create using the `os_workgroup_interval_create` function.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)