<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Dispatch",
  "identifier" : "/documentation/Dispatch/DispatchSource/makeProcessSource(identifier:eventMask:queue:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Dispatch"
    ],
    "preciseIdentifier" : "s:So18OS_dispatch_sourceC8DispatchE17makeProcessSource10identifier9eventMask5queueSo0a1_b1_C5_proc_ps5Int32V_AbCE0F5EventVSo0a1_b1_K0CSgtFZ"
  },
  "title" : "makeProcessSource(identifier:eventMask:queue:)"
}
-->

# makeProcessSource(identifier:eventMask:queue:)

Creates a new dispatch source object for monitoring the specified process.

```
class func makeProcessSource(identifier: pid_t, eventMask: DispatchSource.ProcessEvent, queue: DispatchQueue? = nil) -> any DispatchSourceProcess
```

## Parameters

`identifier`

The process identifier of the process you want to monitor.

`eventMask`

The set of events you want to monitor. For a list of possible values, see [`DispatchSource.ProcessEvent`](/documentation/Dispatch/DispatchSource/ProcessEvent).

`queue`

The dispatch queue to use when executing the installed handlers.

## Return Value

A dispatch source object that conforms to the [`DispatchSourceProcess`](/documentation/Dispatch/DispatchSourceProcess) protocol.

## Discussion

After creating the dispatch source, use the methods of the [`DispatchSourceProtocol`](/documentation/Dispatch/DispatchSourceProtocol) protocol to install the event handlers you need. The returned dispatch source is in the inactive state initially. When you are ready to begin processing events, call its [`activate()`](/documentation/Dispatch/DispatchObject/activate()) method.

---

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)