controlPort
The thread’s control port.
var controlPort: Mach.ThreadControl { get throws }
The thread’s control port.
var controlPort: Mach.ThreadControl { get throws }
import MachCore
The core module for interacting with the Mach kernel.
class Thread
A thread in a task.
struct Mach
The Mach kernel.
class ThreadControl
A thread’s control port.
struct ThreadSpecialPort
A special port for a thread.
func getSpecialPort<PortType>(_ specialPort: Mach.ThreadSpecialPort, as type: PortType.Type = PortType.self) throws -> PortType where PortType : Mach.Port
Gets a special port for the thread.
func setSpecialPort(_ specialPort: Mach.ThreadSpecialPort, to port: Mach.Port) throws
Sets a special port for the thread.
var readPort: Mach.ThreadRead { get throws }
The thread’s read port.
var inspectPort: Mach.ThreadInspect { get throws }
The thread’s inspect port.
convenience init(inTask task: Task) throws
Creates a new thread in a given task.
static var current: Mach.ThreadControl { get }
The current thread.
static func `switch`(to thread: Mach.Thread, option: Mach.ThreadSwitchOption = .none, timeout: mach_msg_timeout_t) throws
Switches to a thread.
var exceptionPorts: [Mach.ExceptionPort] { get throws }
All the exception ports for the thread.
var info: Mach.ThreadInfoManager { get }
The thread’s info manager.
var policy: Mach.ThreadPolicyManager { get }
The thread’s policy.
var state: Mach.ThreadStateManager { get }
The thread’s state.
func abort(safely: Bool = true) throws
Aborts the thread.
func abortDepression() throws
Aborts the depression of the thread.
func addExceptionPort(_ exceptionPort: Mach.ExceptionPort) throws
Adds an exception port to the thread.
func exceptionPorts(mask: Mach.ExceptionMask) throws -> [Mach.ExceptionPort]
Gets the exception ports for the thread that catch the exception types specified by the mask.
func getVoucher() throws -> Mach.Voucher
Gets the voucher for the thread.
func resume() throws
Resumes the thread.
func setVoucher(_ voucher: Mach.Voucher) throws
Sets the voucher for the thread.
func suspend() throws
Suspends the thread.
func swapExceptionPort(_ exceptionPort: Mach.ExceptionPort) throws -> [Mach.ExceptionPort]
Swaps an exception port for the thread and returns the previous exception ports.
func swapVoucher(_ voucher: Mach.Voucher) throws -> Mach.Voucher
Sets the voucher for the thread and returns the previously-set voucher.
func terminate() throws
Terminates the thread.
func unwire(in host: Mach.Host = .current) throws
Unwires a thread.
func wire(in host: Mach.Host = .current) throws
Wires a thread.