<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.6.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Dispatch",
  "identifier" : "/documentation/Dispatch/dispatch_source_get_mask",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Dispatch"
    ],
    "preciseIdentifier" : "c:@F@dispatch_source_get_mask"
  },
  "title" : "dispatch_source_get_mask"
}
-->

# dispatch_source_get_mask

Returns the mask of events monitored by the dispatch source.

```
extern uintptr_t dispatch_source_get_mask(dispatch_source_t source);
```

## Parameters

`source`

This parameter cannot be `NULL`.

## Discussion

### Return Value

The return value should be interpreted according to the type of the dispatch source, and can be one of the following:

- [`DISPATCH_SOURCE_TYPE_MACH_SEND`](/documentation/Dispatch/DISPATCH_SOURCE_TYPE_MACH_SEND):  `Dispatch Source Mach Send Event Flags`
- [`DISPATCH_SOURCE_TYPE_PROC`](/documentation/Dispatch/DISPATCH_SOURCE_TYPE_PROC): `Dispatch Source Process Event Flags`
- [`DISPATCH_SOURCE_TYPE_VNODE`](/documentation/Dispatch/DISPATCH_SOURCE_TYPE_VNODE): `Dispatch Source Vnode Event Flags`

## Discussion

The mask is a bitmask of relevant events being monitored by the dispatch event source. Any events that are not specified in the event mask are ignored and no event handler block is submitted for them.

For details, see the flag descriptions in `Constants`.

---

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)