---
title: "makeProcessSource(identifier:eventMask:queue:)"
framework: dispatch
role: symbol
role_heading: Type Method
path: "dispatch/dispatchsource/makeprocesssource(identifier:eventmask:queue:)"
---

# makeProcessSource(identifier:eventMask:queue:)

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

## Declaration

```swift
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 doc://com.apple.dispatch/documentation/Dispatch/DispatchSource/ProcessEvent.
- `queue`: The dispatch queue to use when executing the installed handlers.

## Return Value

Return Value A dispatch source object that conforms to the DispatchSourceProcess protocol.

## Discussion

Discussion After creating the dispatch source, use the methods of the 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() method.

## See Also

### Creating a Process Source

- [DispatchSourceProcess](dispatch/dispatchsourceprocess.md)
- [DispatchSource.ProcessEvent](dispatch/dispatchsource/processevent.md)
